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 145482 - Paste of opaque image from AbiWord mangles color, alpha channels
Paste of opaque image from AbiWord mangles color, alpha channels
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-06 02:35 UTC by Brion Vibber
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
AbiWord document containing an opaque RGB image. (60.61 KB, application/octet-stream)
2004-07-06 02:36 UTC, Brion Vibber
  Details
Quick program to check selection targets and optionally extract to stdout (1.18 KB, text/plain)
2004-07-06 02:38 UTC, Brion Vibber
  Details
The PNG posted to the selection by AbiWord (43.60 KB, image/png)
2004-07-06 02:38 UTC, Brion Vibber
  Details
As pasted into the Gimp and saved. (32.59 KB, image/png)
2004-07-06 02:39 UTC, Brion Vibber
  Details
Workaround patch (853 bytes, patch)
2004-07-06 05:45 UTC, Brion Vibber
none Details | Review
Workaround patch converting alpha one line at a time (1.32 KB, patch)
2004-07-06 18:19 UTC, Brion Vibber
none Details | Review

Description Brion Vibber 2004-07-06 02:35:07 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).
Comment 1 Brion Vibber 2004-07-06 02:36:55 UTC
Created attachment 29254 [details]
AbiWord document containing an opaque RGB image.

Tested AbiWord 2.0.5/Mac (X11) and 2.1.3/Linux.
Comment 2 Brion Vibber 2004-07-06 02:38:19 UTC
Created attachment 29255 [details]
Quick program to check selection targets and optionally extract to stdout

./gpastajho image/png > copied-image.png
Comment 3 Brion Vibber 2004-07-06 02:38:56 UTC
Created attachment 29256 [details]
The PNG posted to the selection by AbiWord
Comment 4 Brion Vibber 2004-07-06 02:39:45 UTC
Created attachment 29257 [details]
As pasted into the Gimp and saved.
Comment 5 Brion Vibber 2004-07-06 05:45:12 UTC
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.)
Comment 6 Sven Neumann 2004-07-06 08:17:29 UTC
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.
Comment 7 Brion Vibber 2004-07-06 18:19:31 UTC
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?
Comment 8 Sven Neumann 2004-07-07 15:09:50 UTC
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.