problem with jpegtopnm after adding GPS tags...

Started by Archive, May 12, 2010, 08:53:49 AM

Previous topic - Next topic

Archive

[Originally posted by ark on 2005-07-06 21:57:26-07]

here is an image I added GPS tags to, sadly jpegtopnm wont decode it anymore (it would with the original which I've now lost)

http://wtwf.com/tmp/BADEXIF.JPG

I'll try and get some before and after images

$ jpegtopnm BADEXIF.JPG >/dev/null

jpegtopnm: WRITING PPM FILE
jpegtopnm: End-of-file encountered in the middle of JPEG image.

this breaks image importing into gallery (gallery.sf.net) which is a total bummer. I've also had one or two photos not import into iPhoto (OSX) due to a similar problem

the jpeg validator here

http://www.pberndt.com/Projekte.Codesnipplets.Snipplets.JPEG+Validator.html

rejects the image as invalid

any idea what's going on?

ark

Archive

[Originally posted by exiftool on 2005-07-07 00:45:28-07]

I have taken a look at this image.  It is missing a few bytes at the end of the image data.

I can't see how ExifTool could do this, because the code to copy the image data is particularly simple, and the return codes of the writing routines are all checked to detect any errors such as may occur if the disk fills up.

I tried writing the four GPS tags you had set in this image to my test suite of more than 200 JPEG images from various sources, then validated each of the resulting images and none of them showed this problem.

It would be really helpful if I could reproduce the problem.  A before/after image would be great.  Also, what version of exiftool are you using, and what specific commands did you use to modify the file?

I appreciate your help in trying to track down the source of this problem.

Archive

[Originally posted by exiftool on 2005-07-07 14:38:10-07]

I re-ran the tests with another set of files on a different computer.  Still no problems.

Another thing to consider is that this type of file corruption can even happen in a simple file transfer since it is just a few bytes missing from the end of the file.  Also, ExifTool will not generate a warning when rewriting a file like this since it doesn't validate the image data at the end of the file for speed reasons, so the corruption could have occurred before you ran ExifTool.

You mentioned that jpegtopnm didn't complain about the original, but is it possible that the image was subsequently corrupted by copying or modifying with some other software either before or after you ran ExifTool?

Archive

[Originally posted by ark on 2005-07-09 15:59:12-07]

Thanks so much for all the work you've done on this. it's possible that the image could have been corrupted when it was imported into iPhoto. I'm taking more pictures today so I will try and repeat and also include command lines used.
Thanks again.