Thread

Posted on Fri Nov 24 19:30:18 2006 by themonk
exiftool can hang on corrupt jpeg
Hi Phil

We managed to get exiftool to hang whilst writing to a corrupt JPEG...

The JPEG which was ONLY 2 bytes long

\377\330

...Not quite sure how this occurs and we will improve our error checking so that this image is rejected before it gets to ExifTool...

However....

If exiftool comes across such an image and you try and modify it's contents then it will hang indefinately...

exiftool will correctly identify this as an invalid file if you try and read the tags.

Mark
Direct Responses: 3617 | Write a response
Posted on Fri Nov 24 20:15:33 2006 by exiftool in response to 3616
Re: exiftool can hang on corrupt jpeg
Thanks for this bug report, however I'm not sure I am able to reproduce this error. When I try writing to the specified JPEG, I get the following:

exiftool a.jpg -exif:xresolution=1 Use of uninitialized value in numeric eq (==) at lib/Image/ExifTool/Writer.pl line 3076. Error: Corrupted JPEG image - a.jpg 0 image files updated 1 files weren't updated due to errors

It doesn't hang (or even crash), but it does produce an unwanted run-time error that could be avoided. I have prepared a 6.58 pre-release version which avoids this error and uploaded it here.

If this solves your problem, great. Otherwise, please give me a more specific example of what the command line that is giving you problems and I should be able to sort it out.

- Phil
Direct Responses: 3623 | Write a response
Posted on Mon Nov 27 13:40:52 2006 by themonk in response to 3617
Re: exiftool can hang on corrupt jpeg
Hi Phil...

I found the issue, we were running with an old version, 5.93..
We also have a version of 6.51 installed but we have not switched over to it, yet....

When I re-tested with 6.51 the update did not hang....

Thanks....

Mark
Direct Responses: 3634 | Write a response
Posted on Mon Nov 27 21:44:43 2006 by exiftool in response to 3623
Re: exiftool can hang on corrupt jpeg
Please do not use version 6.51. It has a bug with the potential to corrupt images. I suggest downloading the current version (6.58) instead.

But I'm glad to hear your problem was fixed.

- Phil
Write a response