Project

General

Profile

Bug #558

"Warning: JPEG format error, rc = 5" for most of my JPEG files

Added by mhx - over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
jpeg parser
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

For most images taken with my Sony A700 I'm getting the
above warning. The reason is that the SOF segment can
completely confuse the parser as it doesn't adjust the
file pointer for that segment. (I.e. it will read over
the segment boundary and may or may not sync afterwards.)

Additional information:

The attached patch fixes the problem.


Files

exiv2-0.17-jpg-sof-fix.diff (562 Bytes) exiv2-0.17-jpg-sof-fix.diff Redmine Admin, 13 Jun 2008 16:13

History

#1

Updated by Andreas Huggel over 13 years ago

Thanks for the report and patch.
Could you attach a sample image as well?
(I downloaded one from dpreview.com but that works fine and my internet connection is currently so ridiculously slow that it doesn't make sense to keep trying)

#2

Updated by mhx - over 13 years ago

I'd love to, but the smallest image I could find is still
5.5 MB, which appears to be too large to handle for the
bugtracker.

You can grab the image from:

http://mhx.dyndns.org/pics/dsc00025.jpg
#3

Updated by mhx - over 13 years ago

Also, this issue makes batch processing files incredibly slow,
as the code usually jumps past the SOS marker after the SOF
segment and gets lost in the compressed image data. So it
scans the whole file instead of exiting just after discovery
of the SOS marker.

mhx@r2d2 ~/data/images/2008-06-11 $ time ~/src/c/test/exiv2-0.17/src/exiv2 *.jpg >/dev/null 2>&1

real 0m21.170s
user 0m0.990s
sys 0m0.680s

mhx@r2d2 ~/data/images/2008-06-11 $ time ~/src/c/test/exiv2-0.17-mhx/src/exiv2 *.jpg >/dev/null 2>&1

real 0m3.176s
user 0m0.330s
sys 0m0.050s

I did flush the filesystem cache before each run, the timings
are reproducible. So that's almost a slowdown by a factor of 7,
which makes a huge difference in applications that always scan
the whole image folder.

#5

Updated by Andreas Huggel over 13 years ago

This fix will be part of 0.17.1 to be released within the next few days.
I usually mention all contributors by name in the ChangeLog (w/o email address). Please let me know how I should refer to you in the ChangeLog.

Thanks,
Andreas

Also available in: Atom PDF