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 556741 - Alpha layer automatically added (in psd format) but not desired.
Alpha layer automatically added (in psd format) but not desired.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.1
Other All
: Normal minor
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-10-17 14:29 UTC by MENET Rodrigue
Modified: 2008-10-22 06:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
An example of .psd using alpha layers as reference points (66.74 KB, application/octet-stream)
2008-10-20 08:23 UTC, MENET Rodrigue
  Details
Make sure that no transparency information is written for indexed PSD files (553 bytes, patch)
2008-10-21 13:35 UTC, Dennis Ranke
committed Details | Review

Description MENET Rodrigue 2008-10-17 14:29:25 UTC
Please describe the problem:
The problem, as i described in title, is simple. When you open a native .psd image, you do anything in this image and then save it. The result is the creation of a non-desired alpha layer named Transparency. It causes an important problem when you want to use an exporter which manipulates alpha layers.

Steps to reproduce:
1. Open a native .psd image
2. Change it (as you want)
3. Save it
4. Close it
5. Open it again
6. Notice the apparition of the non-desired alpha layer


Actual results:
A non-desired alpha layer appears

Expected results:
Avoid to create this alpha layer

Does this happen every time?
Always

Other information:
This bug wasn't in the 2.4 version, it appears with the 2.6 (or maybe the 2.5 which i didn't use)
Comment 1 Sven Neumann 2008-10-17 16:46:54 UTC
This was added as a feature, see bug #551231. What problems does it create?
Comment 2 MENET Rodrigue 2008-10-20 08:20:09 UTC
At my work, we develop on a support which understand alpha layers like containers of reference points. I think, simply, you have to not create this alpha layer (Transparency) when the .psd already contains one (or several). I join an example of .psd we use.
Comment 3 MENET Rodrigue 2008-10-20 08:23:08 UTC
Created attachment 120908 [details]
An example of .psd using alpha layers as reference points
Comment 4 Sven Neumann 2008-10-21 06:26:45 UTC
Dennis, could you please have a look at this bug report? Thanks.
Comment 5 Dennis Ranke 2008-10-21 07:59:44 UTC
Yes, I can reproduce this with the example .psd. As far as I can see, this only affects indexed PSDs. Can you confirm that?

Saving transparency information for indexed psds is clearly an error. I'll try to create a fix for this later today.
Comment 6 MENET Rodrigue 2008-10-21 08:27:19 UTC
We only manipulate indexed PSDs. So I can confirm it happens on all indexed PSDs but i'm not shure it's the only concerned format.(But as far as I'm concerned if you fix this we won't have any problem : selfish ^^).

If you fix this today, when can we hope to see a new version containing the fix ? (I really apreciate the new version 2.6, but due to this bug I have to use the 2.4 :) )
Comment 7 Dennis Ranke 2008-10-21 13:35:34 UTC
Created attachment 121011 [details] [review]
Make sure that no transparency information is written for indexed PSD files

Ok, this patch fixes this bug by flattening the merged image if it is indexed and has alpha. (The patch is against the 2.6 branch, but it should apply just as well to trunk.)
This should be done in any case, but it looks to me as if gimp_layer_new_from_visible always creates a layer with alpha for indexed images, regardless of whether the source image has alpha. I'm not sure whether that is intentional.

@MENET Rodrigue: I have no idea when the next minor version of GIMP will be released.
Comment 8 Sven Neumann 2008-10-22 06:47:31 UTC
gimp_layer_new_from_visible() always creates a layer with alpha, no matter what mode the image has. The projection always has an alpha channel.
Comment 9 Sven Neumann 2008-10-22 06:50:18 UTC
Thanks for the patch. Applied to both branches:

2008-10-22  Sven Neumann  <sven@gimp.org>

	Bug 556741 – Alpha layer automatically added (in psd format) but
	not desired

	* plug-ins/file-psd/psd-save.c: applied patch from Dennis Ranke
	that flattens the projection for indexed images.