Bug #66771 [NEW]: exif_read_data returns malformed array

From: Date: Tue, 25 Feb 2014 18:19:39 +0000
Subject: Bug #66771 [NEW]: exif_read_data returns malformed array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184427@lists.php.net to get a copy of this message
From: peter at oncefuture dot com Operating system: Linux PHP version: 5.4.25 Package: EXIF related Bug Type: Bug Bug description:exif_read_data returns malformed array Description: ------------ exif_read_data returns malformed arrays (missing a closing parens) when reading from certain image files that come straight out of the camera (ie. no processing in any image manipulation/management program like photoshop). I can reproduce this on files from Samsung, Nikon, etc. Test script: --------------- $exif = @exif_read_data( $file ); print_r($exif, true); Test image files are here: http://goo.gl/Ry5fG6 Expected result: ---------------- Produces a malformed array without a closing paren: Array ( [FileName] => Samsung-Galaxy-S3-123.jpg [FileDateTime] => 1393350070 [FileSize] => 1811414 [FileType] => 2 [MimeType] => image/jpeg [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP [COMPUTED] => Array ( [html] => width="3264" height="2448" [Height] => 2448 [Width] => 3264 [IsColor] => 1 [ByteOrderMotorola] => 0 [ApertureFNumber] => f/2.6 [UserComment] => ø; [Thumbnail.FileType] => 2 [Thumbnail.MimeType] => image/jpeg [Thumbnail.Height] => 120 [Thumbnail.Width] => 160 ) [ImageWidth] => 3264 [ImageLength] => 2448 [Make] => SAMSUNG [Model] => GT-I9300 [Orientation] => 1 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [Software] => I9300XXEMA2 [DateTime] => 2013:03:22 08:25:41 [YCbCrPositioning] => 1 [Exif_IFD_Pointer] => 224 [THUMBNAIL] => Array ( [ImageWidth] => 160 [ImageLength] => 120 [Compression] => 6 [Orientation] => 1 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [JPEGInterchangeFormat] => 5046 [JPEGInterchangeFormatLength] => 7730 ) [ExposureTime] => 1/1444 [FNumber] => 26/10 [ExposureProgram] => 3 [ISOSpeedRatings] => 80 [ExifVersion] => 0220 [DateTimeOriginal] => 2013:03:22 08:25:41 [DateTimeDigitized] => 2013:03:22 08:25:41 [ComponentsConfiguration] => ) Actual result: -------------- Array ( [FileName] => Samsung-Galaxy-S3-123.jpg [FileDateTime] => 1393350070 [FileSize] => 1811414 [FileType] => 2 [MimeType] => image/jpeg [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP [COMPUTED] => Array ( [html] => width="3264" height="2448" [Height] => 2448 [Width] => 3264 [IsColor] => 1 [ByteOrderMotorola] => 0 [ApertureFNumber] => f/2.6 [UserComment] => ø; [Thumbnail.FileType] => 2 [Thumbnail.MimeType] => image/jpeg [Thumbnail.Height] => 120 [Thumbnail.Width] => 160 ) [ImageWidth] => 3264 [ImageLength] => 2448 [Make] => SAMSUNG [Model] => GT-I9300 [Orientation] => 1 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [Software] => I9300XXEMA2 [DateTime] => 2013:03:22 08:25:41 [YCbCrPositioning] => 1 [Exif_IFD_Pointer] => 224 [THUMBNAIL] => Array ( [ImageWidth] => 160 [ImageLength] => 120 [Compression] => 6 [Orientation] => 1 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [JPEGInterchangeFormat] => 5046 [JPEGInterchangeFormatLength] => 7730 ) [ExposureTime] => 1/1444 [FNumber] => 26/10 [ExposureProgram] => 3 [ISOSpeedRatings] => 80 [ExifVersion] => 0220 [DateTimeOriginal] => 2013:03:22 08:25:41 [DateTimeDigitized] => 2013:03:22 08:25:41 [ComponentsConfiguration] => -- Edit bug report at https://bugs.php.net/bug.php?id=66771&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66771&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66771&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66771&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66771&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66771&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66771&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66771&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66771&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66771&r=support Expected behavior: https://bugs.php.net/fix.php?id=66771&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66771&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66771&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66771&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66771&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66771&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66771&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66771&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66771&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66771&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66771&r=mysqlcfg

« previous php.bugs (#184427) next »