jimwebb
Forum Replies Created
-
David,
That’s great! It works on those pesky weird images. Thanks very much for the fix, especially since it’s such a weird edge case, and for getting back to me so promptly. I very much appreciate it and holler if I can return the favor.
Best,
JimThanks for your response!
The S3 plugin, if you’re interested, is here: https://github.com/humanmade/S3-Uploads.
I see exactly what you’re saying on line 3585 with the $size variable, though I would think an alternative could be to check $size similarly to how $info is being checked elsewhere:
if ( is_callable( 'exif_read_data' ) && !empty($size[2]) && in_array( $size[2], array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) {You’re exactly right that in those particular JPEGs (not all are affected, and I don’t understand the X factor of why some are affected and others not), I can’t extract EXIF data. But it is useful to extract IPTC and XMP data, and that’s exactly what I’m using it for.
Here’s a test file: https://assets.joelsartore.com/stock/ANI107/ANI107-00071.jpg. It happens to have XMP data but no IPTC metadata (and it’s possible that’s part of the X factor) — but again, it only fails when I use S3 and Streamwrapper; if I try ingesting the image locally off the file system, it seems to work fine.
Thanks!
Jim