php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79687 Sony picture - PHP Warning - Make, Model, MakerNotes
Submitted: 2020-06-11 09:34 UTC Modified: 2020-06-13 12:14 UTC
From: 7tonin at laposte dot net Assigned: cmb (profile)
Status: Closed Package: EXIF related
PHP Version: 7.3.18 OS: linux 5.6.14-desktop-2.mga7 x86
Private report: No CVE-ID: None
 [2020-06-11 09:34 UTC] 7tonin at laposte dot net
Description:
------------
The thumbnail of a SONY picture can not be loaded with exif_thumbnail function.
PHP Warning:  exif_thumbnail(image.jpg): IFD data too short: 0x000C offset 0x000C
IFD0.Make : SONY
IFD0.Model : DSC-W55
EXIF.MakerNote (not seen) : SONY DSC

But, by changing the Exif:make tag value from SONY to Sony, or to SYNO, or even almost whatever else, the thumbnail is loaded.

Switching from "SONY" to "Sony" value for Exif:make tag changes the way PHP see the Exif sections.

This topic from exiftool.org forum gives details about struggle around this problem.
https://exiftool.org/forum/index.php?topic=11303.0 


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-11 09:39 UTC] 7tonin at laposte dot net
-: antonin dot roussel at laposte dot net +: 7tonin at laposte dot net
 [2020-06-11 09:39 UTC] 7tonin at laposte dot net
exif_read_data function is also impacted
 [2020-06-11 12:53 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-06-11 12:53 UTC] cmb@php.net
Could you please make the image file available somewhere else for
download?
 [2020-06-12 07:32 UTC] cmb@php.net
-Status: Feedback +Status: Not a bug
 [2020-06-12 07:32 UTC] cmb@php.net
Thanks for sending the image by mail!

I can confirm the reported behavior, but I cannot see why that
would be a bug.  The PHP warning for the unmodified image
correlates to exiftool's:

  Warning                         : Bad MakerNotes directory
 [2020-06-12 12:36 UTC] 7tonin at laposte dot net
I understand PHP is not supposed to solve problems potentially dropped by image editors. This picture seems cropped before I had received it.

Previous PHP version did succeed in retrieving thumbnailImage from Exif. Can we call that a regression ?

On my webserver, with the warning comes the modification of file rights to apache:apache (owner:group). I suspect httpd more than PHP, or maybe a secure layer behaviour.

Anyway, the workaround is easy.
 [2020-06-12 14:34 UTC] cmb@php.net
-Status: Not a bug +Status: Re-Opened
 [2020-06-12 14:34 UTC] cmb@php.net
> Previous PHP version did succeed in retrieving thumbnailImage
> from Exif. Can we call that a regression ?

Indeed.  I had solely focused on exif_read_data(), but ignored
that extracting the thumbnail fails.
 [2020-06-13 12:13 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
On GitHub:  https://github.com/php/php-src/pull/5709
Patch:      https://github.com/php/php-src/pull/5709.patch
 [2020-06-13 12:14 UTC] cmb@php.net
-Status: Re-Opened +Status: Verified
 [2020-06-13 16:34 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5621c5faf899c94baa2b41acb457494ca30368c3
Log: Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
 [2020-06-13 16:34 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC