After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 145212 - Gimp 2.0 can't open "corrupt" JPG file
Gimp 2.0 can't open "corrupt" JPG file
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.0.x
Other All
: High major
: 2.0
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-06-30 18:38 UTC by Dennis
Modified: 2004-07-13 11:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.0


Attachments
corrupt jpg sample file (90.00 KB, image/jpeg)
2004-06-30 18:40 UTC, Dennis
Details

Description Dennis 2004-06-30 18:38:53 UTC
Gimp 2.0 (windows version (at least)) can't open the jpeg files that my agfa
ephoto cl20 ('old' 1M pixel) digital camera takes. It complains with the
following messages:

1. Corrupt JPEG data: 250 extraneous bytes before marker 0xd9
2. Gimp Message: Plug-In could not open image
3. Gimp Message: Plug-In crashed "jpeg.exe"
4. (gimp-2.0.exe:2304): LibGimpBase-WARNING **: gimp-2.0.exe: wire_read(): error

All my other programs are able to open it .. Firefox/IrfanView/ACDSee.

Here is one of those "corrupt" images ...
http://individual.utoronto.ca/nezic/tmp/dntest.jpg (temporary)

- The problem is reproduceable in linux.

- The same error occurs when openning the image with Konqueror (web browser) on
KDE. Although, despite the error warning (A message from libjpeg .. "Corrupt
JPEG data: 250 extraneous bytes ..."), Konqueror is able to display it.
Comment 1 Dennis 2004-06-30 18:40:40 UTC
Created attachment 29123 [details]
corrupt jpg sample file
Comment 2 weskaggs 2004-06-30 21:31:49 UTC
A stack trace shows that the crash is actually occurring in libexif, presumably
because there is corrupt EXIF data in the file, or something that looks like
EXIF data.  I rebuilt Gimp 2.1.1 with --without-libexif, and then Gimp gave the
usual error message but loaded the file successfully.

This is a rather unfortunate situation, because libexif, while on the whole
pretty robust and well-written code, does not seem to be maintained in any
formal way at this time.  It is hosted on SourceForge -- I left a message in
their forum a couple of months ago, asking if anybody was around, and there was
no response.  
Comment 3 Sven Neumann 2004-07-01 00:13:27 UTC
At what point does the plug-in die? If it hasn't created any resources in the
core  before it crashes then the crash is rather harmless.
Comment 4 weskaggs 2004-07-01 01:48:02 UTC
Well, the exif part is the last thing that happens.  The crash is actually
*almost* harmless in another sense -- Gimp does load the image, and you can find
it in the Layers dialog, and even copy the layer data by dragging from the
Layers dialog, but the image does not get a display.  Basically the image is
fully created but because of the crash the jpeg plug-in never gets around to
returning its ID to the core.
Comment 5 Sven Neumann 2004-07-01 15:25:47 UTC
That's rather bad then.
Comment 6 weskaggs 2004-07-01 19:05:27 UTC
The exif stuff doesn't use anything the plug-in has done earlier -- it works
directly from the file name -- so I suppose it would be possible to move it to
the beginning of the load_image routine, and cause the crash to occur
immediately, if that were desireable.
Comment 7 Manish Singh 2004-07-07 12:34:09 UTC
2004-07-07  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/jpeg.c: Don't try to load EXIF data if any warnings
        happened, cause that likely means corruption and libexif doesn't
        handle that very happily. Addresses bug #145212. Perhaps the error and
        warning messages should be propagated to the user in the GUI somehow,
        currently they are not.
Comment 8 Manish Singh 2004-07-07 12:35:05 UTC
Leaving open until the error/warning message policy is nailed down, and the fix
backported to 2.0.x.
Comment 9 Sven Neumann 2004-07-13 11:14:57 UTC
I've changed the error handling so that the warning from libjpeg is shown to the
user:

2004-07-13  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/jpeg.c: override the output_message error
	handler in order to propagate warnings to the user interface
	(related to bug #145212).
Comment 10 Sven Neumann 2004-07-13 11:21:21 UTC
Merged to the stable branch, closing as FIXED.

2004-07-13  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/jpeg.c: merged fix for bug #145212 (JPEG plug-in
	crashes on corrupt EXIF data) from HEAD branch.