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 145373 - Floating selection without alpha channel shows boundary at 50% blue
Floating selection without alpha channel shows boundary at 50% blue
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.0.x
Other All
: Low minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-04 08:13 UTC by Brion Vibber
Modified: 2005-09-08 19:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot showing misplaced marching ants boundary (23.45 KB, image/png)
2004-07-04 08:19 UTC, Brion Vibber
  Details
patch for app/core/gimpimage.c (781 bytes, patch)
2005-03-21 19:30 UTC, weskaggs
rejected Details | Review

Description Brion Vibber 2004-07-04 08:13:35 UTC
I'm working on a plugin to support cut-and-paste of images using the Mac OS X system clipboard. 
(http://sf.net/projects/gimp-mac-helper/) In trying to mimic Gimp's internal cut-and-paste behavior, 
I'm attaching the pasted layer as a floating selection. 

When pasting images with alpha this works fine, but when creating a layer without an alpha channel to 
paste an opaque image, the marching ants boundary is incorrectly shown at the 50% threshold of the 
blue channel instead of around the layer's edge.

This is probably due to an assumption that floating layers are always from internal pasting, that pasted 
buffers always have alpha (cf bug 134304), and thus that the last channel is always an alpha channel.

I can work around this by always pasting with alpha, but it'd be nice if it weren't 
necessary.
Comment 1 Brion Vibber 2004-07-04 08:19:15 UTC
Created attachment 29198 [details]
Screenshot showing misplaced marching ants boundary
Comment 2 Sven Neumann 2004-07-04 09:13:08 UTC
All layers but the background layer need to have an alpha channel. Where's the
problem?

BTW, since GIMP from CVS supports the system clipboard, it is questionable if
your plug-in makes sense. It would be better to join the GIMP development and
help to make the new clipboard work well with Mac OS X instead of adding an
extra plug-in for it.
Comment 3 Brion Vibber 2004-07-04 10:13:36 UTC
> All layers but the background layer need to have an alpha channel. Where's the
> problem?

Well, in that case it's rather surprising that I can create such a layer from a plugin. Shouldn't this error 
condition be detected?
Comment 4 Sven Neumann 2004-07-04 10:38:15 UTC
IIRC, GIMP-1.2 used to add an alpha channel but IMO this is the wrong behaviour.
GIMP should probably just reject such a layer to be added to the image's layer
stack.
Comment 5 Sven Neumann 2004-11-02 18:30:25 UTC
This one will be easily forgotten here on the 2.0.6 milestone. Moving to 2.2
instead.
Comment 6 weskaggs 2005-03-21 19:30:16 UTC
Created attachment 39028 [details] [review]
patch for app/core/gimpimage.c

Here is a simple patch that rejects layers without alpha added at any position
except 0.  Seems to work okay, but probably will turn out to break one or two
badly written scripts or plug-ins, so not suitable for the stable branch.
Comment 7 Sven Neumann 2005-03-21 20:02:55 UTC
Comment on attachment 39028 [details] [review]
patch for app/core/gimpimage.c

Such a check must be done in the PDB wrappers. It is completely unacceptable
for the application to use g_warning() in this case, since g_warning()
indicates a programming error.
Comment 8 Michael Natterer 2005-09-08 19:39:25 UTC
Fixed in CVS:

2005-09-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer-floating-sel.c (floating_sel_boundary): if
	the floating selection has no alpha, manually create BoundSegs of
	its outline instead of calling boundary_find() (which creates a
	boundary of the last channel). Fixes bug #145373.

	* app/widgets/gimplayertreeview.c
	(gimp_layer_tree_view_floating_selection_changed): update all
	layer names' text attributes, not only for layers with alpha.
	Fixes layer name display when making a new layer out of a floating
	selection without alpha.