GNOME Bugzilla – Bug 145482
Paste of opaque image from AbiWord mangles color, alpha channels
Last modified: 2004-12-22 21:47:04 UTC
Copying an opaque image (no alpha) from an AbiWord document and pasting it into Gimp, the color channels of the pasted layer are mangled: red -> red red -> green red -> blue blue -> alpha I can extract the image/png target from the selection to a file, and the file opens correctly in Gimp and other apps, so the problem seems to be on the Gimp end. An image with an alpha channel (for instance, anything copied from Gimp to AbiWord) works fine. Tested on Fedora Core 2/x86 and Mac OS X 10.3+Fink unstable (under X11).
Created attachment 29254 [details] AbiWord document containing an opaque RGB image. Tested AbiWord 2.0.5/Mac (X11) and 2.1.3/Linux.
Created attachment 29255 [details] Quick program to check selection targets and optionally extract to stdout ./gpastajho image/png > copied-image.png
Created attachment 29256 [details] The PNG posted to the selection by AbiWord
Created attachment 29257 [details] As pasted into the Gimp and saved.
Created attachment 29261 [details] [review] Workaround patch Patch to convert an alphaless pixbuf to alpha on paste, working around the problem. (But see bug 134304 about 'Paste as New' and images without alpha.)
It would really not have been necessary to submit a bug report since the cut'n'paste functionality is still being worked on and didn't appear in any released version yet. Your patch will certainly work but it is a major memory hog to create yet another pixbuf. If we decide to solve this issue by adding the alpha channel when pasting, then we should add the alpha channel while converting to the tile manager.
Created attachment 29291 [details] [review] Workaround patch converting alpha one line at a time As per comment #6. Uglier code, but uses less memory for conversion. Sven, would you prefer that I post bug materials & patches that only affect 2.1 to gimp-devel rather than bugzilla?
2004-07-07 Sven Neumann <sven@gimp.org> * app/core/gimplayer.c (gimp_layer_new_from_tiles): add an alpha channel if the src tile-manager doesn't have one. Warn on unsupported type conversions instead of silently doing the wrong thing. Fixes bug #145482.