GNOME Bugzilla – Bug 526811
can't load layer masks from psd files
Last modified: 2008-10-30 20:12:05 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.
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.
Please attach a small example image.
Created attachment 108938 [details] original xcf file this one is how it's supposed to look
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
Created attachment 108940 [details] this is the broken psd file sorry, the original one wasn't uploaded correctly, hopefully this one will work
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.
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.
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.