php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72735 Samsung picture thumb not read (zero size)
Submitted: 2016-08-02 14:33 UTC Modified: 2016-08-05 05:45 UTC
From: antonin dot roussel at laposte dot net Assigned: kalle (profile)
Status: Closed Package: EXIF related
PHP Version: 5.6.24 OS: Mageia5
Private report: No CVE-ID: None
 [2016-08-02 14:33 UTC] antonin dot roussel at laposte dot net
Description:
------------
Extracting thumbnail of pictures in a gallery is ok (for instance nikon camera pictures), but for Samsung ST72/ST73 camera pictures it's broken. The data return by exif_thumbnail php function has a zero strlentgh.

To cross-check : command line exiftool sees exif preview and thumbnail data.
So there is a problem.

I can provide two sample pictures.



Patches

0001-Fix-72735-regression-in-exif-for-MakerNote.patch (last revision 2016-08-03 08:38 UTC by remi@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-02 16:07 UTC] kalle@php.net
Any chance you can leave a link to the pictures here in case a developer decides to pick it up?
 [2016-08-02 16:07 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2016-08-02 22:08 UTC] antonin dot roussel at laposte dot net
-Status: Feedback +Status: Open
 [2016-08-02 22:08 UTC] antonin dot roussel at laposte dot net
Here are some sample files, and a test script.
'sam4068.jpg',	//   broken (it's coming from a friend)
'samsung.jpg',	// * broken (minimized)
'dscn5460.jpg',	// * ok (from my camera)
'nokia.jpg',	// * ok (minimized)
// * star means : have been processed by exiftool and convert

https://www.dropbox.com/sh/ru4kwqsyt9fqd89/AACTpWWpBojkNuYGkFgsLWj2a?dl=0
 [2016-08-03 03:40 UTC] kalle@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=406dff2a02ff1cfac89942ce5e991d88d3b6cb50
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 [2016-08-03 03:40 UTC] kalle@php.net
-Status: Open +Status: Closed
 [2016-08-03 03:42 UTC] kalle@php.net
-Status: Closed +Status: Feedback -Assigned To: +Assigned To: kalle
 [2016-08-03 03:42 UTC] kalle@php.net
I committed a possible fix to this on master. In my debugging it seems that there were 2 IDF tags in samsung.jpg that were returning invalid, that stopped processing (more description are available in the commit message).

Could you please test and confirm on your end? Ps. its master in git, which is PHP 7.2, thanks!
 [2016-08-03 04:10 UTC] kalle@php.net
I've reverted the fix since it seems to break other tests within ext/exif, so I will need a tiny bit more debugging to make sure it will work.

Apologies for the crushed dreams /o\
 [2016-08-03 04:10 UTC] kalle@php.net
-Status: Feedback +Status: Assigned
 [2016-08-03 04:11 UTC] kalle@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aa821d8cad082634c554c6a5ed9233cdc24b9cff
Log: Revert "Fixed bug #72735 (Samsung picture thumb not read (zero size))"
 [2016-08-03 04:11 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2016-08-03 04:18 UTC] kalle@php.net
-Status: Closed +Status: Assigned
 [2016-08-03 05:11 UTC] remi@php.net
Could be related to recent security fix (#50845, #72603, #72618)

Also reported as https://bugzilla.redhat.com/1362571 (with Panasonic samples)
 [2016-08-03 08:03 UTC] kalle@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9c8c37854efe843e45228597837fc4b6aac59113
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 [2016-08-03 08:03 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2016-08-03 08:06 UTC] kalle@php.net
-Status: Closed +Status: Assigned
 [2016-08-03 08:06 UTC] kalle@php.net
@remi, can you confirm this patch also fixes the other issue from Redhat?
 [2016-08-03 08:06 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2016-08-03 08:10 UTC] remi@php.net
The following patch has been added/updated:

Patch Name: 0001-Fix-72735-regression-in-exif-for-MakerNote.patch
Revision:   1470211812
URL:        https://bugs.php.net/patch-display.php?bug=72735&patch=0001-Fix-72735-regression-in-exif-for-MakerNote.patch&revision=1470211812
 [2016-08-03 08:25 UTC] antonin dot roussel at laposte dot net
I do not have php development environment, I won't be able to test any patch.

I added two other sample pictures, from two sony camera. One is ok (sony_dslr-a700.jpg), the second (sony_dsc-rx100.jpg) shows a slightly different broken aspect.
 [2016-08-03 08:27 UTC] remi@php.net
@Kalle: your patch is fine, but only for SAMSUNG, Fedora bug is about Panasonic, please give a try to my complementary fix proposal.
 [2016-08-03 08:34 UTC] remi@php.net
Probably, should be

     length = MIN(length, strlen(value));
 [2016-08-03 08:38 UTC] remi@php.net
The following patch has been added/updated:

Patch Name: 0001-Fix-72735-regression-in-exif-for-MakerNote.patch
Revision:   1470213526
URL:        https://bugs.php.net/patch-display.php?bug=72735&patch=0001-Fix-72735-regression-in-exif-for-MakerNote.patch&revision=1470213526
 [2016-08-03 12:52 UTC] antonin dot roussel at laposte dot net
sorry, there is no "slightly different aspect"
 [2016-08-03 14:40 UTC] kalle@php.net
@antonin, can you open another report and assign it to me and I will take a look at it, just reference this as it makes the whole process a little easier to deal with. Thanks (and thanks for helping PHP become even greater!)
 [2016-08-03 14:50 UTC] kalle@php.net
@Remi, one thing I was thinking about your patch, should we add a notice/warning in case we run out of possible signatures to match against, urging users to submit a bug report so we can cease out these types of reports?
 [2016-08-03 14:54 UTC] antonin dot roussel at laposte dot net
you misunderstood me, I was just inflecting my comment about added sample picture sony_dsc-rx100.jpg which indeed appears as broken as others do.
I cannot evaluate patches.
Thank you for making php handy ;-)
 [2016-08-05 05:45 UTC] kalle@php.net
I have added basic Sony support for pictures containing Sony specific EXIF data within the Exif.Sony1 namespace into the master branch
 [2016-10-10 11:17 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9c8c37854efe843e45228597837fc4b6aac59113
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 [2016-10-10 11:17 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aa821d8cad082634c554c6a5ed9233cdc24b9cff
Log: Revert "Fixed bug #72735 (Samsung picture thumb not read (zero size))"
 [2016-10-10 11:17 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=406dff2a02ff1cfac89942ce5e991d88d3b6cb50
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 [2017-01-12 09:12 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9c8c37854efe843e45228597837fc4b6aac59113
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 [2017-01-12 09:13 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=aa821d8cad082634c554c6a5ed9233cdc24b9cff
Log: Revert "Fixed bug #72735 (Samsung picture thumb not read (zero size))"
 [2017-01-12 09:13 UTC] krakjoe@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=406dff2a02ff1cfac89942ce5e991d88d3b6cb50
Log: Fixed bug #72735 (Samsung picture thumb not read (zero size))
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC