ID: 13213
Comment by: lee at klres dot com
Reported By: pulstar at mail dot com
Status: Closed
Bug Type: GetImageSize related
Operating System: Linux RedHat 7.1
PHP Version: 4.1.1
Assigned To: helly
New Comment:
How do I repair a jpg file with uknown format? Burned from memory tsick
to CD, but now can't open any of them.
Previous Comments:
------------------------------------------------------------------------
[2004-02-01 16:05:51] lee at klres dot com
How do I repair a jpg file with uknown format? Burned from memory tsick
to CD, but now can't open any of them.
------------------------------------------------------------------------
[2003-12-15 17:04:02] [EMAIL PROTECTED]
Also see: Bug #25905 getimagesize fail with some jpegs
------------------------------------------------------------------------
[2002-03-10 07:15:50] janderk at digitaldutch dot com
I'm the main developer of Arles Image Web Page Creator, the application
that generated those JPEG's with the illegal comment section. I got an
email about this PHP BUG report from a user asking me to repair this
Arles bug.
FYI: It was a bug in an older versions of Arles and has been repaired
in the latest releases. It was actually caused by a bug in the Intel
JPEG library we used at that time.
I'm glad that we could help making PHP more robust in reading corrupted
images ;)
------------------------------------------------------------------------
[2002-03-09 11:04:37] [EMAIL PROTECTED]
Took a closer look on the file.
The promlem is that both photo1 and photo3 have an illegal comment
section. The section is appended by some 0x00 where 0xFF were expected.
As other software ignores the NULLs i will add this to CVS / php4.3
version.
------------------------------------------------------------------------
[2002-03-08 11:44:25] [EMAIL PROTECTED]
The current CVS implementation has been improoved on that.
As you can see from exif's debug warnings. photo1 and photo3 are
illegal. An internal section says it is longer than the file :-(
I could implement handling that but it would blow up code.
I will consider the applied patch...
photo1.jpg
GetImageSize [ , , , ]
exif_read_data exif_read_data returned false
Invalid JPEG/TIFF file: 'photo1.jpg'
21
PHP Warning: error reading from file: got=x3648(=13896) !=
itemlen-2=x4EE1(=20193)
photo2.jpg
GetImageSize [ 640, 480, 2, width="640" height="480" ]
exif_read_data exif_read_data returned false
O.K.
22
photo3.jpg
GetImageSize [ , , , ]
exif_read_data exif_read_data returned false
Invalid JPEG/TIFF file: 'photo3.jpg'
23
PHP Warning: error reading from file: got=x1E3D(=7741) !=
itemlen-2=xF698(=63128)
photo4.jpg
GetImageSize [ 640, 480, 2, width="640" height="480" ]
exif_read_data exif_read_data returned false
O.K.
------------------------------------------------------------------------
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
http://bugs.php.net/13213
--
Edit this bug report at http://bugs.php.net/?id=13213&edit=1