Bug #72278 [Ana->Csd]: getimagesize returning FALSE on valid jpg

From: Date: Sat, 13 Aug 2016 14:40:10 +0000
Subject: Bug #72278 [Ana->Csd]: getimagesize returning FALSE on valid jpg
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203241@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72278&edit=1

 ID:                 72278
 Updated by:         cmb@php.net
 Reported by:        bfarber at invisiopower dot com
 Summary:            getimagesize returning FALSE on valid jpg
-Status:             Analyzed
+Status:             Closed
 Type:               Bug
 Package:            GetImageSize related
 Operating System:   AWS / Windows
 PHP Version:        5.6.22
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=82df4e263886a0da21a00c98189649287666ba5c
Log: Fix #72278: getimagesize returning FALSE on valid jpg


Previous Comments:
------------------------------------------------------------------------
[2016-08-13 12:59:11] cmb@php.net

While fixing this issue, I've stumbled upon bug #13213, which has
been fixed for that very special case only. IMO, it would have
been better to follow mul at rentapacs dot com's suggestion to
simply skip any extraneous bytes (plus raising a warning). That
appears also the solution chosen by ImageMagick, but not by ext/gd
(I'll have a closer look at that later).

------------------------------------------------------------------------
[2016-06-05 04:47:28] requinix@php.net

@bfarber uploaded one to http://bfarber.com/getimagesize_test/image.jpg,
which is still accessible. (I've tried a couple free hosting places but they reprocess images.)

------------------------------------------------------------------------
[2016-06-05 04:22:26] php-bugs at lists dot php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.

------------------------------------------------------------------------
[2016-05-28 04:01:19] pajoye@php.net

Can you upload the image somewhere pls or send it to me pls?

------------------------------------------------------------------------
[2016-05-27 22:28:41] requinix@php.net

The image has some extra bytes in it that are messing up the detection, but there's not much
technical information about JPEGs out there and the standard itself is paywalled so I can't
verify if it's technically legal or just a vendor quirk. If I open the image in GIMP it warns
me about the extra bytes and recovers.

Those extra bytes are part of the 0xE1 Exif frame starting at offset 0x15. It says length
0x7D08/32008 but there are then 260 bytes of 0x00 unaccounted for until the next 0xFFED. Image
suggests it's from Photoshop CS2?

Could image.c's php_next_marker gracefully handle this situation? Automatically consume any
"leading" nulls it finds?

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


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=72278


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


Thread (9 messages)

« previous php.bugs (#203241) next »