Thread

Posted on Fri Jul 27 17:37:41 2007 by vik
bad image
Dear Phil,

You have been a really big help in all of my metadata and image problems. I can't thank you enough on how much knowledge I have gained about still imagery and metadata through your forum. I again have another problem with an image. When I try to modify say the caption field. exifTool returns

perl exiftool -description="test" bad070724-F-0870p-012.jpg

Error: Corrupted JPEG image -

o image files updated

1 files weren't updated due to errors

I would really appreciate if you could find what could be wrong with the following jpg.

http://download.yousendit.com/C85597F94F8E96B1

Regards,

Vik
Direct Responses: 5821 | Write a response
Posted on Fri Jul 27 17:54:20 2007 by exiftool in response to 5818
Re: bad image
The size of the APP1 segment in this image is incorrect -- it doesn't span the full size of the segment. For this reason, a JPEG parser will likely not be able to find the image data in this file. However, the data is there, and the file is recoverable if the APP1 segment size is repaired.

To repair the file, change the two bytes at offset 0x16 in the file from 0x30bc to 0x310c. After doing this you can view and edit the image normally.

- Phil
Direct Responses: 5822 | Write a response
Posted on Fri Jul 27 18:02:05 2007 by exiftool in response to 5821
Re: bad image
I just noticed that the ThumbnailLength value is also wrong by 0x50 bytes, so the ThumbnailImage is truncated but otherwise the image is OK after this repair.

But this gives us a clue as to why the image is corrupted. The originating software got the size of the ThumbnailImage wrong, so it calculated the size of the APP1 segment incorrectly (it thought it would be 0x50 bytes smaller than it actually was). So this was definitely a software bug, and not a problem with a file transfer corruption.

- Phil
Write a response