Bug 220454

Summary: Over-Exposure and Under-Exposure indicators do not work correctly in White Balance dialogue [patch]
Product: [Applications] digikam Reporter: Richard Ash <richard>
Component: Plugin-Editor-WhiteBalanceAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 1.1.0
Sentry Crash Report:
Attachments: Image loaded into the image editor (base line I am starting from).
What happens when I select white balance, +1.5 stop exposure, over-exposure indicator on, screen shot from 1.0.0 release version.
What happens when I select white balance, +1.5 stop exposure, over-exposure indicator on, screen shot from 1.0.0-beta5
PATCH fixes not working over/under exposure with 16bit images
PATCH, updated version, fixes also new introduced warning about unused member variable, sorry

Description Richard Ash 2009-12-28 21:23:19 UTC
Version:           1.0.0-beta6 and 1.0.0 (using KDE 4.3.3)
Compiler:          gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4 Affects amd64 and x86 builds.
OS:                Linux
Installed from:    Gentoo Packages

1 Load a RAW file (any from Canon 450D) into Image Editor (not using Raw Import Tool, 16 bit colour, camera white balance, rebuild highlights mode, auto brightness enabled). Image at this point normally has no saturated areas.
2 Choose White Balance tool from the Color menu.
3 Raise the Exposure Compensation value so that the light areas of the image become saturated white.
4 Click on the over exposure indicator at the top right of the image.

I would expect step 4 to turn the over-exposed areas of the image black, as selected in the preferences as the over-exposure colour. However in 1.0.0-beta6 and 1.0.0 release, a few random pixels may turn black, but they have no correlation to the over-exposed parts of the image, which will remain the over-exposed white they were before.

The same problem occurs with the under-exposure indicator, with a pattern of dots which look like the wrong image is being used to generate the mask or something.

This worked correctly in versions up to 1.0.0-beta5 and is still fine now I have reverted back to that version (but re-compiled from source today, so the offending change is in digikam not a library).
Comment 1 caulier.gilles 2009-12-28 21:27:22 UTC
You want to test and report a bug. Great. But use a stable release, not an old beta. 1.0.0 is out just in time for Christmas. Install it and try again.

Gilles Caulier
Comment 2 Richard Ash 2009-12-28 21:51:09 UTC
I did test the 1.0.0 release - it has exactly this bug in it. That's why I started to report a bug.

I then went back and tried betas between the last version I knew worked (1.0.0-beta5) and there to try and localise the problem, which leads me to say it was last working in 1.0.0-beta5, and first broken in 1.0.0-beta6.

This is a bug in the 1.0.0 release (which I installed today), but it was first introduced between the 1.0.0-beta5 and 1.0.0-beta6 releases.
Comment 3 Marcel Wiesweg 2009-12-29 14:52:27 UTC
Richard, do I understand correctly that the indicator highlights those areas it should highlight without applying the change?
Does it work correctly once the tool has applied its changes?
Comment 4 Richard Ash 2009-12-29 17:16:44 UTC
The preview image turns the bright areas white correctly, both in the preview and when I apply the change (press OK). Once I've done so the image looks the same as the preview (correct), however the indicators don't work.

In fact in the main Image Editor window, the under- and over-exposure indicators (at the bottom right of the screen) are disabled, greyed out and can't be clicked on. I can enable the under-exposure indicator using the F10 key, and both indicators using the entries in the View menu (at which point the buttons stop being greyed out and can be clicked on). The indicators don't work correctly however, they behave the same as in the white balance preview:
* The under-exposure indicator shows a few pixels, but not enough and in the wrong place. They do have some relationship to the image however, because they move depending on the image you have loaded.
* The over-exposure indicator doesn't appear to do anything at all, even with obvious over-exposure (which shows up in older versions quite happily).

I will attach the three screen shots - the image when I first load it, the image when I apply +1.5 stops correction and ask for over-exposure indication in the 1.0.0 stable release, and the same image doing the same thing in 1.0.0-beta5, which is what I consider to be the "correct" behaviour.
Comment 5 Richard Ash 2009-12-29 17:19:10 UTC
Created attachment 39428 [details]
Image loaded into the image editor (base line I am starting from).

This image doesn't have any over-exposure to indicate (ignore under-exposure for the moment).
Comment 6 Richard Ash 2009-12-29 17:21:16 UTC
Created attachment 39429 [details]
What happens when I select white balance, +1.5 stop exposure, over-exposure indicator on, screen shot from 1.0.0 release version.

This screen shot from the 1.0.0 stable release has obvious over-exposure, but it isn't being indicated (as far as I can see).
Comment 7 Richard Ash 2009-12-29 17:24:53 UTC
Created attachment 39430 [details]
What happens when I select white balance, +1.5 stop exposure, over-exposure indicator on, screen shot from 1.0.0-beta5

This screen shot from the 1.0.0-beta5 version has obvious over-exposure, which is duly indicated (black) when the over-exposure indicator is selected (button top right of image). Note that this seems disconnected from the buttons for the same purpose at the bottom right of the whole UI, which I didn't try to use.
Comment 8 Jens Mueller 2009-12-29 19:06:10 UTC
Created attachment 39433 [details]
PATCH fixes not working over/under exposure with 16bit images
Comment 9 caulier.gilles 2009-12-29 19:18:40 UTC
Thanks Jens. Great to see you very active. 

I propose to become a real contributor using an account to KDE svn repository ? 

What do you think about ?

Gilles Caulier
Comment 10 caulier.gilles 2009-12-30 11:33:53 UTC
Jens,

Why ? : 

[  0%] Building CXX object digikam/digikam/CMakeFiles/digikamcore.dir/__/libs/dimg/dimg.o                                                     
/mnt/data/devel/SVN/trunk/graphics/digikam/libs/dimg/dimg.cpp: In member function ‘QImage Digikam::DImg::pureColorMask(Digikam::ExposureSettingsContainer*)’:                                                                                                                               
/mnt/data/devel/SVN/trunk/graphics/digikam/libs/dimg/dimg.cpp:1611: attention : unused variable ‘s_alpha’

Gilles Caulier
Comment 11 Jens Mueller 2009-12-30 13:53:46 UTC
Created attachment 39456 [details]
PATCH, updated version, fixes also new introduced warning about unused member variable, sorry
Comment 12 caulier.gilles 2009-12-30 14:10:13 UTC
SVN commit 1067737 by cgilles:

apply patch #39456 from Jens Mueller
BUGS: 220454


 M  +31 -37    dimg.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1067737
Comment 13 Richard Ash 2009-12-30 17:29:22 UTC
Working fine for me as well, thanks! Patch also applies to 1.0.0 release so I've rolled it into the 1.0.0 package for Gentoo to avoid other people hitting the same problem (http://bugs.gentoo.org/show_bug.cgi?id=295459).