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 555222 - PSD Load Plugin: unsupported compression mode
PSD Load Plugin: unsupported compression mode
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.0
Other All
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-10-06 13:01 UTC by Heiko Schmidt
Modified: 2008-10-08 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file not loadable (830.17 KB, application/x-zip-compressed)
2008-10-07 06:29 UTC, Heiko Schmidt
  Details
PSD load plugin in Gimp 2.5.4 (26.10 KB, application/x-download)
2008-10-07 18:43 UTC, Heiko Schmidt
  Details
Patch to skip empty channels/layers (1.30 KB, patch)
2008-10-08 00:00 UTC, Chris Mohler
none Details | Review
psd-proper-load-fix-2008-10-08.patch (1.76 KB, patch)
2008-10-08 17:27 UTC, Martin Nordholts
committed Details | Review
Another PSD that craches GIMP (274.38 KB, image/x-psd)
2008-10-08 17:52 UTC, Chris Mohler
  Details

Description Heiko Schmidt 2008-10-06 13:01:52 UTC
The loading of certain PSD files is not possible. It appears the following error message: Unsupported compression mode: 33279.

Someone (using Photoshop) made some tests and told me is could be caused by empty layers. In 2.5.4 the issue didn't exist and might be introduced by fixing this bug 544939.
Comment 1 Martin Nordholts 2008-10-06 17:04:24 UTC
The fix for bug 544939 was included in 2.5.4, so if it works in 2.5.4 the error can not have been introduced by that fix.

Are you sure it worked in 2.5.4? Could you attach the file please?
Comment 2 Heiko Schmidt 2008-10-07 06:29:03 UTC
Created attachment 120090 [details]
file not loadable 

Yes it works in 2.5.4. The error (the error message) was another one by bug 544939. The file still attached in that bug loads without problems.
Comment 3 Martin Nordholts 2008-10-07 07:10:38 UTC
If it works in 2.5.4 we should get it to work in the 2.6 series. Putting on the 2.6 milestone. I still really doubt it worked in 2.5.4 if it doesn't work in 2.6.0, because there were afaics no changes to the PSD plugin between 2.5.4 and 2.6.0. I'll try for myself later...
Comment 4 Michael Schumacher 2008-10-07 16:40:34 UTC
This file does fail to load in GIMP 2.5.4 with the same error message.
Comment 5 Martin Nordholts 2008-10-07 17:03:06 UTC
My conclusion is the same on a freshly built GIMP 2.5.4 on Linux. So the question now is, exactly in what version did this file load properly? (Heiko, look in Help -> About.)
Comment 6 Chris Mohler 2008-10-07 17:41:38 UTC
It loads OK for me in 2.5.0 (built from source, linux).
Comment 7 Heiko Schmidt 2008-10-07 18:43:58 UTC
Created attachment 120147 [details]
PSD load plugin in Gimp 2.5.4 

Ok I checked it again with Gimp 2.5.4 and the file loads well although the progress bar stops for a short moment. I checked Help - About and it says 'Gimp 2.5.4'. The stable version (in this case 2.6.0) is always installed under C:\Programme\Gimp-2.0. The development version 2.5.4 I have in C:\Programme\Gimp-2.5. Attached is the psd load plugin which is in C:\Programme\GIMP-2.5\lib\gimp\2.0\plug-ins and again this plugin opens the file without problems. I downloaded Gimp 2.5.4 here (http://sourceforge.net/project/showfiles.php?group_id=121075)
Comment 8 Martin Nordholts 2008-10-07 19:16:32 UTC
Maybe someone should just try to make the file load...
Comment 9 Chris Mohler 2008-10-08 00:00:16 UTC
Created attachment 120171 [details] [review]
Patch to skip empty channels/layers

This gets the image in question to load.  I'm not sure if the formatting is 100%, but hopefully it works.  I have not done any extensive testing.
Comment 10 Martin Nordholts 2008-10-08 05:25:53 UTC
Thank you for taking the time to make a patch! As far as I know though, that patch will reintroduce bug 544939 :( Could you try that please?

Oh and btw, no tabs in the source code please. And we are not C99 yet so you can't define a local variable mid-block.
Comment 11 Martin Nordholts 2008-10-08 17:27:30 UTC
Created attachment 120208 [details] [review]
psd-proper-load-fix-2008-10-08.patch

The patch did indeed introduce bug 544939 but the proper fix is very natural when one thinks about it. It would be very nice if one of you guys could apply this patch and load a variety of PSD files you have. The patch loads both the PSD in this bug report and the PSD in bug 544939 but testing on more PSD will definitly not hurt.
Comment 12 Chris Mohler 2008-10-08 17:52:53 UTC
Created attachment 120212 [details]
Another PSD that craches GIMP

The last patch works for me - I loaded about 40 PSD files with no issues.  However, this PSD attachment causes a segfault in both 2.5.0 and 2.6.0.  It appears to be a separate issue (at least to me).
Comment 13 Michael Natterer 2008-10-08 18:02:27 UTC
Doesn't the compiler warn about "comp_mode" might be used uninitialized?
Comment 14 Martin Nordholts 2008-10-08 18:13:42 UTC
It didn't, and probably can not be of any harm, but you have a fair point so I fixed that.

Thank you very much Chris for testing the patch. I have now commited it to trunk, rev 27175:

2008-10-08  Martin Nordholts  <martinn@svn.gnome.org>

        Bug 555222 – PSD Load Plugin: unsupported compression mode

        * plug-ins/file-psd/psd-load.c (add_layers): Some PSD files can
        have channels where a compression method used for the channel data
        is specified, but without any actual channel data. Handle this
        case. Fix inspired by patch from Chris Mohler.

then trunk rev 27176:

2008-10-08  Martin Nordholts  <martinn@svn.gnome.org>

	* plug-ins/file-psd/psd-load.c (add_layers): Decrease scope of
	comp_mode and initialize it.

The new PSD file does indeed crash because of a different reason. Can you create a separate bug report and attach that files please? I will then add a stack trace for the crash for you.