Bug #75785 [Com]: Many errors from exif_read_data

From: Date: Tue, 22 Jan 2019 01:48:26 +0000
Subject: Bug #75785 [Com]: Many errors from exif_read_data
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219118@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75785&edit=1

 ID:                 75785
 Comment by:         richard at dpiworld dot com
 Reported by:        opajaap at opajaap dot nl
 Summary:            Many errors from exif_read_data
 Status:             Assigned
 Type:               Bug
 Package:            EXIF related
 Operating System:   unknown
 PHP Version:        7.2.1
 Assigned To:        kalle
 Block user comment: N
 Private report:     N

 New Comment:

Same issue using 7.2.14 on CentOS 7.  Code and images work fine with PHP 5.4.16 but with PHP 7.2.14
exif text output is truncated so can't get GPS data. Can't extract thumbnails with
exif_thumbnail().  These things are critical for my application and will delay moving to PHP 7. 
EXEC exiftool is slow.   FYI, the vote system here gets an HTTP 500 error and fails.


Previous Comments:
------------------------------------------------------------------------
[2018-10-23 09:45:43] mike dot blomgren at tornado dot se

exif_read_data does not read all EXIF information in certain JPEG files.

Sample JPG here, that has the problem:
https://www.tornado.se/piwigo/tools/sample.jpg

Using exif_read_data produces the following output of 'sample.jpg':
https://www.tornado.se/piwigo/tools/metadata.php

I.e. it is not complete (using print_r and var_dump). The apache server produces the followong
errors in error_log:

[Tue Oct 23 11:38:47.425214 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP Warning:
 read_exif_data(sample.jpg): Process tag(x010D=DocumentNam): Illegal components(0) in
/var/wwwtornado/htdocs/piwigo/tools/metadata.php on line 93
[Tue Oct 23 11:38:47.425234 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP Stack
trace:
[Tue Oct 23 11:38:47.425240 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP   1.
{main}() /var/wwwtornado/htdocs/piwigo/tools/metadata.php:0
[Tue Oct 23 11:38:47.425243 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP   2.
read_exif_data() /var/wwwtornado/htdocs/piwigo/tools/metadata.php:93
[Tue Oct 23 11:38:47.425353 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP Notice: 
Undefined index: IFD0 in /var/wwwtornado/htdocs/piwigo/tools/metadata.php on line 110
[Tue Oct 23 11:38:47.425364 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP Stack
trace:
[Tue Oct 23 11:38:47.425370 2018] [php7:notice] [pid 3514] [client 195.198.34.135:1104] PHP   1.
{main}() /var/wwwtornado/htdocs/piwigo/tools/metadata.php:0

Using exif_read_data seems to 'cut' up to a certain point of the EXIF header. Specifically
I want to extract the DateTimeOriginal value, but php 7.2.11 isn't able to find the value.
Using jhead or exiftool fully decodes all the EXIF headers.

------------------------------------------------------------------------
[2018-10-17 22:08:54] gino0631 at centaurus dot cloud

It seems this issue is still present in PHP 7.2.11, e.g. with the sample image provided in this
comment: https://github.com/gino0631/nextcloud-metadata/issues/19#issuecomment-414079570

------------------------------------------------------------------------
[2018-07-25 07:24:28] jbe at geo6 dot be

I have the same issue since a few days.

Here is my PHP version :

PHP 7.2.7-2+0~20180714182401.1+jessie~1.gbp3fcba8 (cli) (built: Jul 15 2018 13:57:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.7-2+0~20180714182401.1+jessie~1.gbp3fcba8, Copyright (c) 1999-2018, by
Zend Technologies

------------------------------------------------------------------------
[2018-07-17 15:55:09] kalle@php.net

Thanks for the zip! I will try take a look if there is something obviously wrong in ext/exif.

Ps. I think the reason its fixed in newer versions is due to stas@ security fixes that could have
flipped the coin and actually make them work.

------------------------------------------------------------------------
[2018-07-17 09:26:34] opajaap at opajaap dot nl

Sorry, they are no longer there. Try https://betatest.opajaap.nl/wp-content/wppa-depot/opajaap/phpbug.zip
this zip contains 5 of them.

FYI: Seems to be fixed in php 7.2.7

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=75785


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


Thread (14 messages)

« previous php.bugs (#219118) next »