fabarea / media

Media management system for TYPO3 CMS
Other
30 stars 25 forks source link

[BUGFIX] PHP Warning when reading EXIF metadata from uploaded images #190

Closed lgescobar closed 5 years ago

lgescobar commented 7 years ago

When uploading files using the Media backend module, the post-processing step rotate tries to figure out the actual extension of the image by reading it from the EXIF metadata if the needed PHP function is available.

It turns out that the function exif_read_data is affected by a known bug and ends up throwing a PHP warning and raising an exception in my case. This prevents the post-processing stage rotate to use the fallback orientation and counts as an error regarding the file upload.

Error JavaScript log:

[Fine Uploader 5.0.9] responseText = {"error":"PHP Warning: exif_read_data(FILENAME.JPG): IFD data bad offset: 0xFFFFFD5E length 0x1E06 in \/[...]\/typo3conf\/ext\/media\/Classes\/FileUpload\/Optimizer\/Rotate.php line 80"}

[Fine Uploader 5.0.9] Received response status 200 with body: {"error":"PHP Warning: exif_read_data(FILENAME.JPG): IFD data bad offset: 0xFFFFFD5E length 0x1E06 in \/[...]\/typo3conf\/ext\/media\/Classes\/FileUpload\/Optimizer\/Rotate.php line 80"}