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 470698 - MapObject cannot modify highlight
MapObject cannot modify highlight
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal trivial
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2007-08-27 13:50 UTC by Matteo 'Peach' Pescarin
Modified: 2009-10-12 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MapObject light bug (32.26 KB, image/png)
2007-08-27 13:51 UTC, Matteo 'Peach' Pescarin
  Details
Proposed patch (520 bytes, patch)
2009-08-10 16:32 UTC, Massimo
needs-work Details | Review
Improved version of the proposed fix (588 bytes, patch)
2009-08-11 11:09 UTC, Massimo
committed Details | Review

Description Matteo 'Peach' Pescarin 2007-08-27 13:50:30 UTC
Please describe the problem:
if you try to insert a value of light intensity different from 27 it will result in a strange black halo.

Steps to reproduce:
1. on the current layer of an image open the filter Map to Object
2. modify the light intensity value on the Material panel to a value different from 27
3. preview it


Actual results:
black halo. It will be very clear if drawn on a sphere

Expected results:
no halo

Does this happen every time?
yep, even under windows with 2.4 rc1

Other information:
svn version compiled under gnu/linux
Comment 1 Matteo 'Peach' Pescarin 2007-08-27 13:51:53 UTC
Created attachment 94426 [details]
MapObject light bug
Comment 2 Raphaël Quinet 2007-08-27 16:32:39 UTC
Indeed, this looks wrong.  The black area can be seen easily if you map to a Sphere or a Cylinder.  It appears as soon as you change the Highlight value from 27 to 27.1 or 26.9.

(Note: the name of the option is Reflectivity / Highlight, not light intensity.  I have updated the title of this bug report accordingly)
Comment 3 Massimo 2009-08-10 16:32:16 UTC
Created attachment 140350 [details] [review]
Proposed patch

This is an oversight, see for example: 
http://en.wikipedia.org/wiki/Specular_highlight
Comment 4 Sven Neumann 2009-08-10 19:32:31 UTC
Please do not use function calls or calculations in a MAX() macro as this macro evaluates its arguments multiple times.
Comment 5 Massimo 2009-08-11 11:09:14 UTC
Created attachment 140422 [details] [review]
Improved version of the proposed fix

Used to C++'s std::max I forgot the dangers of macros.
Comment 6 Michael Schumacher 2009-10-12 19:22:36 UTC
Committed to master and gimp-2-6:

commit 05304f6d8308bec8ba68b1df5a2914df2a62fee0
Author: Massimo Valentini <sixtysix@inwind.it>
Date:   Mon Oct 12 20:26:42 2009 +0200

    Bug 470698 -  MapObject cannot modify highlight

 plug-ins/map-object/map-object-shade.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


commit d67177d74438ff5883e97150f2764af5e7b5af1d
Author: Massimo Valentini <sixtysix@inwind.it>
Date:   Mon Oct 12 20:26:42 2009 +0200

    Bug 470698 -  MapObject cannot modify highlight

 plug-ins/map-object/map-object-shade.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Comment 7 Michael Schumacher 2009-10-12 19:23:22 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 8 Matteo 'Peach' Pescarin 2009-10-12 19:27:56 UTC
(In reply to comment #7)
> This problem has been fixed in our software repository. The fix will go into
> the next software release. Thank you for your bug report.

you're welcome, looking forward to test it!