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 131030 - tiff plugin always assumes premuliplied alpha, doesn't honor EXTRASAMPLES
tiff plugin always assumes premuliplied alpha, doesn't honor EXTRASAMPLES
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
1.x
Other All
: Normal normal
: 2.0
Assigned To: Dave Neary
Daniel Egger
Depends on:
Blocks:
 
 
Reported: 2004-01-09 19:06 UTC by Pablo d'Angelo
Modified: 2004-01-16 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch, first try (22.72 KB, patch)
2004-01-09 19:11 UTC, Pablo d'Angelo
none Details | Review

Description Pablo d'Angelo 2004-01-09 19:07:53 UTC
Currently the tiff plugin violates the tiff specification, by always 
assuming premultiplied alpha. Even if the EXTRASAMPLES tag explicitly 
states otherwise. 
 
EXTRASAMPLES specifies if RGB or Grayvalue are premultiplied with the 
alpha channel. 
 
See the current tiff spec, available at http://partners.adobe.com/ 
asn/developer/PDFS/TN/TIFF6.pdf page 31,32 and 77 for more information. 
 
The following patch enables gimp to read unassociated extra channels 
properly. 
 
Contrary to the current coding style, I used the libtiff types when 
calling libtiff functions, as sven@gimp.org suggested. At least for the 
code that relates to the EXTRASAMPLES tag. 
 
It still saves premultiplied alpha, but it should be easy to add an gui 
option to allow the user to choose unassociated alpha (I'm not familar 
with gtk, so I won't try).
Comment 1 Pablo d'Angelo 2004-01-09 19:11:38 UTC
Created attachment 23177 [details] [review]
patch, first try
Comment 2 Dave Neary 2004-01-09 19:46:20 UTC
This is not quite a duplicate, but it is related to bug #82882, which
has a patch to prevent pre-multiplication of alpha data.
http://bugzilla.gnome.org/show_bug.cgi?id=82882

Thanks for the patches, Pablo :)

Cheers,
Dave.
Comment 3 Dave Neary 2004-01-09 19:56:38 UTC
The GUI for this should be similar to that used for the png plug-in,
as described in bug #129472, which has a patch attached.

Adding PATCH keyword, and setting milestone to 2.0.

Dave.
Comment 4 Pablo d'Angelo 2004-01-09 20:22:24 UTC
Yes, its related to bug #82882, but it actually handles both 
premultiplied and not premultiplied data correctly. 
 
Sorry, I wont add the GUI and change the PDB interface, I simply do 
not have the time to learn all this and provide a 100% foolproof 
solution. 
 
For me, the most important thing is that gimp supports reading the 
tif files written by my panorama stitcher, nona, and that I can 
properly rearrange the alpha channels to adjust the seams between 
the different images after they have been combined. 
 
Originally I wanted to save xcf, but since its a private format... 
 
Comment 5 Dave Neary 2004-01-14 21:06:11 UTC
I'll finish the GUI on this, should be fairly trivial.

Dave.
Comment 6 Dave Neary 2004-01-16 21:29:08 UTC
Patch applied (modified) in CVS.

I used a gboolean save value to indicate saving transparent pixels
(same as png), and used that throughout.

2004-01-16  Dave Neary  <bolsh@gimp.org>
 
        * plug-ins/common/tiff.c: Apply a (modified) patch from Pablo
        d'Angelo to enable saving of a non-premultiplied alpha channel
        and provide an UI to use it (a checkbox and extra PDB
        procedure). Fixes bug #131030.