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 526811 - can't load layer masks from psd files
can't load layer masks from psd files
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.4.x
Other All
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-04-07 20:28 UTC by Gary Watson
Modified: 2008-10-30 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
original xcf file (9.63 KB, application/octet-stream)
2008-04-09 17:20 UTC, Gary Watson
Details
this is the one that is messed up, they should be identical (47.79 KB, text/plain)
2008-04-09 17:21 UTC, Gary Watson
Details
this is the broken psd file (47.79 KB, application/octet-stream)
2008-04-09 17:24 UTC, Gary Watson
Details

Description Gary Watson 2008-04-07 20:28:33 UTC
Please describe the problem:
When an image is saved either in gimp or photoshop that contains layer masks in psd format, when that image is loaded into gimp the next time, the layer masks are gone.  They still appear to have a layer mask applied, but they are empty

Steps to reproduce:
1. create an image that uses a layer mask to obscure part of the layer
2. save the file in psd format
3. close the program and reload the image, the entire layer should be visible, no layer mask


Actual results:
it's as if there aren't any layer masks

Expected results:
the layers that have layer masks would show up the same as when the application was closed

Does this happen every time?
yes

Other information:
Thanks a bunch for a great program, use it every day at my job, other people send me psd files which is why this one affects me so much.
Comment 1 Michael Schumacher 2008-04-08 17:46:40 UTC
From bug #448181:

"Improved layer mask handling."

You should try GIMP trunk or attach some files to give others the possibility to test whether this is better now.
Comment 2 Sven Neumann 2008-04-09 15:18:45 UTC
Please attach a small example image.
Comment 3 Gary Watson 2008-04-09 17:20:41 UTC
Created attachment 108938 [details]
original xcf file

this one is how it's supposed to look
Comment 4 Gary Watson 2008-04-09 17:21:20 UTC
Created attachment 108939 [details]
this is the one that is messed up, they should be identical

this is the one that is messed up, they should be identical
Comment 5 Gary Watson 2008-04-09 17:24:05 UTC
Created attachment 108940 [details]
this is the broken psd file

sorry, the original one wasn't uploaded correctly, hopefully this one will work
Comment 6 Sven Neumann 2008-05-19 08:57:06 UTC
I can save this file as PSD in GIMP 2.5 and load it back almost correctly. The only problem is that the mask is not shown in the loaded image. The mask state is not correctly initialized. We should fix this for 2.6.
Comment 7 Sven Neumann 2008-05-19 13:35:16 UTC
Looking at the code is seems obvious that the PSD save and PSD load code treats the flag in the PSD file format differently. The psd-save routines uses:

 flags = gimp_layer_get_apply_mask (PSDImageData.lLayers[i]) << 1;

and psd-load applies this flag like this:

 gimp_layer_set_apply_mask (layer_id, ! layer_mask.mask_flags.disabled);

So either the save or the load plug-in needs to be fixed. Someone needs to check with the spec or by looking at a PSD file with layer masks written by Photoshop.
Comment 8 Sven Neumann 2008-05-19 14:09:53 UTC
Fixed in trunk:

2008-05-19  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/psd-save.c (save_layer_and_mask): corrected
	"layer mask disabled" flag in layer mask data section (bug #526811).

The layer mask in the example file now survives a PSD save and load cycle. Closing as FIXED for 2.6.