go to bug id or search bugs for
I've verified this is an issue on PHP 5.4, 5.6, and statically on the master branch.
The AWS SDK (https://aws.amazon.com/sdk-for-php/) includes a stream wrapper that by default does not support seeking on files backed by S3. Calling getimagesize() on an image can fail if php_skip_variable() is called. I've seen this happen with images that specify the "Image Quality" EXIF tag, which is the M_APP15 constant in ext/standard/image.c.
The stream documentation states that seeking is not required to be supported by stream wrappers, and it's not clear that getimagesize() needs seeking to work properly.
I see two ways to improve this:
* Log a notice if php_skip_variable() tries to seek on an unseekable stream. That would have saved me a ton of time tracing this with GDB.
* Or, if a stream is not seekable, copy the file to the temporary file system and fetch metadata from there.
Add a Patch
Add a Pull Request