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 510210 - Equalize incorrectly acts on the alpha channel
Equalize incorrectly acts on the alpha channel
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.4.x
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-01-17 16:10 UTC by phi1ipp
Modified: 2008-10-30 20:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for app/base/lut-funcs.c (443 bytes, patch)
2008-01-18 04:48 UTC, weskaggs
accepted-commit_now Details | Review

Description phi1ipp 2008-01-17 16:10:06 UTC
Please describe the problem:
When executing equalise (Colours -> Auto -> Equalise) while having a layer selected whose non-transparent area is not rectangular, the image viewing window shows the manipulation as applying to the WHOLE rectangle covered by the layer, not just the parts that actually contain image data (i.e. not transparent). Other options in Colours -> Auto behave correctly, only manipulating image that actually belongs to the layer.

Steps to reproduce:
1. Open a photo
2. make a non-rectangular selection (mine was feathered, could play a role?)
3. copy selection to a new layer (Ctl+C,Ctl+V, go to layer window, select "floating selection", use button in layer window to "Create new")
4. Colours -> Auto -> Equalise while both layers are set to visible

Actual results:
Image portion covered by layer frame is shown with new colour values corresponding to an "equalise" correction.

Expected results:
Only image portion that actually belongs to layer gets corrected (NB rectangle was not selected, either, and correct layer was active)

Does this happen every time?
Every time I tried.

Other information:
Comment 1 phi1ipp 2008-01-17 16:15:04 UTC
Ran some further tests, and found out that what actually happens is that Equalise causes more image data to be pasted into the layer; i.e. it expands the image to fill the rectangle, taking image data from another layer.

An additional point of note is that it is unclear (to me, at least) how Equalise decides which layer to draw the image data from when it does this. In any case, a highly unorthodox behaviour!
Comment 2 Sven Neumann 2008-01-17 22:20:39 UTC
Could you attach a small example image in XCF format that we can use to try to reproduce the problem?
Comment 3 weskaggs 2008-01-18 04:47:55 UTC
I can confirm this, although the problem description is not quite correct:  what is happening is that "equalize" is equalizing the alpha channel along with the color channels.  I am attaching a patch that should correct it -- this code is used in all of the other lut-funcs in app/base/lut-funcs.c, but apparently was accidentally left out for the "equalize" lut.
Comment 4 weskaggs 2008-01-18 04:48:54 UTC
Created attachment 103114 [details] [review]
patch for app/base/lut-funcs.c
Comment 5 Sven Neumann 2008-01-18 07:17:51 UTC
Looks like the right fix. Please commit in both branches.
Comment 6 weskaggs 2008-01-18 18:19:42 UTC
Fix committed to both branches (after fixing a typo).

2008-01-18  Bill Skaggs  <weskaggs@primate.ucdavis.edu>

	* app/base/lut-funcs.c (equalize_lut_func): Don't 
	equalize the alpha channel.  Fixes bug #510210.