Calling #eof? was a way for Shrine to check whether the file was empty without calling #size (in order to support IO objects that don’t know their size).
I would say that the root issue here is that for some reason the file was not rewinded before determining its MIME type. This may have happened on the application side, because Shrine is normally dilligent about rewinding the file.
Also, I figured out why the file was already at #eof. There’s a custom validator that opens up the file prior to it being passed to shrine. So this is definitely not a bug.
However, I’m thinking would it make sense for shrine to just rewind the file as a precaution before attempting to determine the mime type? (not sure how that affects performance / other IO objects though).