Bug #72819 [Asn->Fbk]: EXIF thumbnails not read anymore

From: Date: Fri, 12 Aug 2016 10:12:35 +0000
Subject: Bug #72819 [Asn->Fbk]: EXIF thumbnails not read anymore
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203208@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72819&edit=1

 ID:                 72819
 Updated by:         cmb@php.net
 Reported by:        php dot bohwaz at miam dot kd2 dot org
 Summary:            EXIF thumbnails not read anymore
-Status:             Assigned
+Status:             Feedback
 Type:               Bug
 Package:            EXIF related
 Operating System:   Debian Linux Jessie
 PHP Version:        5.6.24
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

I've just checked the first image with PHP 5.6.24 and with the
current head of the PHP-5.6 branch. The former gives int(0),
the latter int(21004), so indeed the issue appears to have been
fixed.


Previous Comments:
------------------------------------------------------------------------
[2016-08-12 09:33:44] php dot bohwaz at miam dot kd2 dot org

Yup I saw that bug but the patch seems to only affect Samsung photos, and my problem happens with
every photo I tried, so not sure how that patch would affect this issue.

In any case I will try with the git branch next week just to be sure.

------------------------------------------------------------------------
[2016-08-12 08:42:10] cmb@php.net

This appears to be a duplicate of bug #72735, which has been fixed
as of PHP 5.6.25. Please try this version.

------------------------------------------------------------------------
[2016-08-12 04:47:13] php dot bohwaz at miam dot kd2 dot org

(Continued, as antispam forbids me from posting too many URLs)

with different errors, or sometimes no error, but still no thumbnail:

$ php -r 'var_dump(strlen(exif_thumbnail("http://bohwaz.net/photos/2014/02-fevrier/p20140219_193908.jpg")));'
int(0)

$ php -r 'var_dump(strlen(exif_thumbnail("http://bohwaz.net/photos/2014/01-janvier/p20140117_080901.jpg")));'
                                                                                                    
                                                   
int(0)

$ php -r 'var_dump(strlen(exif_thumbnail("http://bohwaz.net/photos/2014/01-janvier/12-Val_Suzon/p20140112_140758.jpg")));'
                                                                                                    
                                         
PHP Warning:  exif_thumbnail(p20140112_140758.jpg): corrupt EXIF header: maximum directory nesting
level reached in Command line code on line 1

Warning: exif_thumbnail(p20140112_140758.jpg): corrupt EXIF header: maximum directory nesting level
reached in Command line code on line 1
int(0)

------------------------------------------------------------------------
[2016-08-12 04:46:42] php dot bohwaz at miam dot kd2 dot org

Other examples from other cameras:
http://bohwaz.net/photos/2014/02-fevrier/p20140219_193908.jpg
(Panasonic Lumix GF5)
http://bohwaz.net/photos/2014/01-janvier/p20140117_080901.jpg
(Nokia E7 phone)
http://bohwaz.net/photos/2014/01-janvier/12-Val_Suzon/p20140112_140758.jpg
(Fujifilm HS20 EXR)

------------------------------------------------------------------------
[2016-08-12 04:45:19] php dot bohwaz at miam dot kd2 dot org

Description:
------------
I am using PHP to extract thumbnails from JPEG files, and this used to work fine, but I upgraded to
PHP 5.6 (from 5.4) and now it seems that exif_* functions are unable to find thumbnail data in every
JPEG file I'm trying.

Works:

$ php -v && php -r 'var_dump(strlen(exif_thumbnail("http://www.exiv2.org/include/img_1771.jpg")));'
PHP 5.4.45-0+deb7u4 (cli) (built: Jun 29 2016 14:51:18) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
int(5448)

Doesn't work:

$ php -v && php -r 'var_dump(strlen(exif_thumbnail("http://www.exiv2.org/include/img_1771.jpg")));'
PHP 5.6.24-0+deb8u1 (cli) (built: Jul 26 2016 08:17:07) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
PHP Warning:  exif_thumbnail(img_1771.jpg): IFD data bad offset: 0xFFFFFC52 length 0x01C2 in Command
line code on line 1

Warning: exif_thumbnail(img_1771.jpg): IFD data bad offset: 0xFFFFFC52 length 0x01C2 in Command line
code on line 1
int(0)

Same result with exif_read_image_data(), the THUMBNAIL section is never populated.

Other examples from other cameras:
http://bohwaz.net/photos/2014/02-fevrier/p20140219_193908.jpg
(Panasonic Lumix GF5)
http://bohwaz.net/photos/2014/01-janvier/p20140117_080901.jpg
(Nokia E7 phone)
http://bohwaz.net/photos/2014/01-janvier/12-Val_Suzon/p20140112_140758.jpg
(Fujifilm HS20 EXR)


Test script:
---------------
var_dump(strlen(exif_thumbnail("http://www.exiv2.org/include/img_1771.jpg")));

Expected result:
----------------
int(5448)

Actual result:
--------------
PHP Warning:  exif_thumbnail(img_1771.jpg): IFD data bad offset: 0xFFFFFC52 length 0x01C2 in Command
line code on line 1

Warning: exif_thumbnail(img_1771.jpg): IFD data bad offset: 0xFFFFFC52 length 0x01C2 in Command line
code on line 1
int(0)



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72819&edit=1


Thread (28 messages)

« previous php.bugs (#203208) next »