Bug 318726 - Some BQM tools in a workflow don't restore (all) parameters properly [patch]
Summary: Some BQM tools in a workflow don't restore (all) parameters properly [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Unclassified
Component: BatchQueueManager-Workflow (show other bugs)
Version: 3.2.0
Platform: Compiled Sources Linux
: NOR normal with 20 votes (vote)
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-22 16:41 UTC by Matthias Welwarsky
Modified: 2016-07-03 20:12 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments
Solves problem related to Raw Decoding in BQM (1.13 KB, patch)
2014-12-04 17:56 UTC, Jan Wolter
Details
Solves problem with Unsharp Mask tool in BQM (1.25 KB, patch)
2014-12-06 16:59 UTC, Jan Wolter
Details
Solves problem with local contrast tool (1.40 KB, patch)
2014-12-07 13:54 UTC, Jan Wolter
Details
Patch solves problem with iccConvert tool (1.07 KB, patch)
2014-12-10 18:23 UTC, Jan Wolter
Details
I forgot to fix one line related to icc default profile (511 bytes, patch)
2014-12-11 13:17 UTC, Jan Wolter
Details
bqm.patch (8.17 KB, patch)
2015-02-05 22:19 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Welwarsky 2013-04-22 16:41:17 UTC
- ICC convert does not restore the color profile properly: If you look
carefully, you see that at first the correct profile is restored, but a
split-second later it changes back to the default. Something appears to
overwrite the restored value

- Convert2JPEG does not restore the chroma subsampling setting

Reproducible: Always

Steps to Reproduce:
1. Create a batch queue, one item is enough
2. Load a pre-saved workflow containing the ICC convert and Convert2JPEG tools

Actual Results:  
Not all tool settings are restored as saved in the workflow

Expected Results:  
All tools settings return to their saved values
Comment 1 caulier.gilles 2013-07-15 08:15:07 UTC
*** Bug 318771 has been marked as a duplicate of this bug. ***
Comment 2 Martin 2013-07-15 09:04:03 UTC
I'm using 3.0.0 within Kubuntu 12.4

I did set up a batch set for changing the size and then do a crop and save this. Setting it up is working great, running too but when I save it it's missing to save my sizes. In the queue.xml after saving it looks like this:

    <queue>
        <queuetitle value="Make_4to3_1024_quer"/>
        <queuedesc value=""/>
        <renamingparser value="[file]_##"/>
        <useoriginalalbum value="1"/>
        <workingurl value=""/>
        <conflictrule value="1"/>
        <renamingrule value="1"/>
        <rawloadingrule value="1"/>
        <rawdecodingsettings>
            <autobrightness value="1"/>
            <sixteenbitsimage value="0"/>
            <brightness value="1"/>
            <rawquality value="0"/>
            <inputcolorspace value="0"/>
            <outputcolorspace value="1"/>
            <rgbinterpolate4colors value="0"/>
            <dontstretchpixels value="0"/>
            <unclipcolors value="0"/>
            <whitebalance value="1"/>
            <customwhitebalance value="6500"/>
            <customwhitebalancegreen value="1"/>
            <halfsizecolorimage value="0"/>
            <enableblackpoint value="0"/>
            <blackpoint value="0"/>
            <enablewhitepoint value="0"/>
            <whitepoint value="0"/>
            <noisereductiontype value="0"/>
            <noisereductionthreshold value="0"/>
            <enablecacorrection value="0"/>
            <redchromaticaberrationmultiplier value="0"/>
            <bluechromaticaberrationmultiplier value="0"/>
            <medianfilterpasses value="0"/>
            <inputprofile value=""/>
            <outputprofile value=""/>
            <deadpixelmap value=""/>
            <whitebalanceareax value="0"/>
            <whitebalanceareay value="0"/>
            <whitebalanceareawidth value="0"/>
            <whitebalanceareaheight value="0"/>
            <dcbiterations value="-1"/>
            <dcbenhancefl value="0"/>
            <eecirefine value="0"/>
            <esmedpasses value="0"/>
            <nrchrominancethreshold value="0"/>
            <expocorrection value="0"/>
            <expocorrectionshift value="1"/>
            <expocorrectionhighlight value="0"/>
        </rawdecodingsettings>
        <tool>
            <toolname value="Resize"/>
            <toolgroup value="5"/>
            <index value="0"/>
            <version value="1"/>
            <parameter type="bool" value="true" name="LengthCustom"/>
            <parameter type="bool" value="true" name="LengthPreset"/>
            <parameter type="bool" value="true" name="UseCustom"/>
        </tool>
        <tool>
            <toolname value="Crop"/>
            <toolgroup value="5"/>
            <index value="1"/>
            <version value="1"/>
            <parameter type="bool" value="true" name="heightInput"/>
            <parameter type="bool" value="true" name="widthInput"/>
            <parameter type="bool" value="true" name="xInput"/>
            <parameter type="bool" value="true" name="yInput"/>
        </tool>
    </queue>

for the Rezise tool it should have saved 2250 for length somehwere and for the crop it should have saved real values for hieght, width, y and y, but it didn't.
Comment 3 Jan Wolter 2014-09-03 09:58:57 UTC
I noticed on my digiKam 4.2 comparable problems regarding the tools curved adjust, b&w convert, and lens auto-correction. I have the following problems:

CURVES ADJUST:
When I add the curves adjust tool to the Batch Queue and create a curve, it will not be saved in the queue.xml file, as you can see here (no values for the different channels are saved):
<tool>
            <toolname value="CurvesAdjust"/>
            <toolgroup value="3"/>
            <index value="0"/>
            <version value="1"/>
            <parameter type="bool" value="true" name="curvesDepth"/>
            <parameter type="int" value="0" name="curvesType"/>
            <parameter type="QPolygon" value="" name="values[AlphaChannel]"/>
            <parameter type="QPolygon" value="" name="values[BlueChannel]"/>
            <parameter type="QPolygon" value="" name="values[GreenChannel]"/>
            <parameter type="QPolygon" value="" name="values[LuminosityChannel]"/>
            <parameter type="QPolygon" value="" name="values[RedChannel]"/>
        </tool>
The problem becomes visible for the user, when digikam is restarted (and therefore, the workflows get loaded from the queue.xml file): Open Batch Queue Manager and reload the workflow that contains the curves adjust tool. Then your defined curve is lost and the only default curve is shown.


B&W CONVERT:
Here is a similar problem as in the adjust curves tool: the luminosity curve is not saved in the queue.xml file.


LENS AUTO-CORRECTION:
When the radio button "Use Metadata" is selected, the set of corrections (chromatic aberration, vignetting, color, distortion, and geometry) that could be applied to a picture can be selected via radio buttons as well. But independent of the selected set of corrections, in the queue.xml file they are all marked as true:
<tool>
            <toolname value="LensAutoFix"/>
            <toolgroup value="4"/>
            <index value="0"/>
            <version value="1"/>
            ......
            <parameter type="bool" value="true" name="filterCCA"/>
            <parameter type="bool" value="true" name="filterCCI"/>
            <parameter type="bool" value="true" name="filterDST"/>
            <parameter type="bool" value="true" name="filterGEO"/>
            <parameter type="bool" value="true" name="filterVIG"/>
            ......
        </tool>
And when I deselect the "Use Metadata" button, the radio buttons to select the corrections are grayed out. I wonder if this is the correct behaviour. I guess that the corrections should be selectable by the user independent of using manual setting or metadata information.
Comment 4 Jan Wolter 2014-10-01 18:12:33 UTC
I tested the remaining BQ-Tools and found the following errors, problems, or suggestions for improvements:

LOCAL-CONTRAST:
Add local contrast tool to the workflow and assign values to the "Power" and "Blur" parameters of the four stages. Then save the workflow, close digikam and restart it afterwards. When you load the saved workflow, all "Power" and "Blur" parameters are set to 0, unless they are saved in the queue.xml in the correct way.

UNSHARP-MASK:
Use the unsharp mask tool in a workflow and assign to the "Radius" parameter a value with a decimal place unequal 0 (e.g. 2,8). Then start processing the workflow and look up the Xmp.digiKam.ImageHistory tag in the meta data of the processed image. There you see an entry like this: <param name="radius" value="2"/>, where decimal position is cropped. Using the unsharp mask tool in the image editor, this error is only noticeable.

RESIZE:
Add resize tool to workflow, use custom length and choose a length with slider. Save the workflow, close digikam and restart it. When you reload the workflow, the slider displays in any case length "10" unless you have chosen another value before.
Furthermore, the resize tool in BQ is less powerful than the resize tool in the image editor. In BQ it is not possible to resize images to another aspect ratio then the actual image's aspect ratio.

I tested Martins Problem from Comment #2 as well and can say that workflows using the crop and resize tool are saved correctly to the queue.xml

I'm quite sure that the three errors in local contrast, unsharp mask and resize tool in addition to the errors in the curves adjust, b&w, and lens auto-correction tools (reported by the comment #3) are the last errors concerning BQ tools. I tested really a lot, by defining different workflows, comparing the saved queue.xml as well as the XMP image history in the processed image. I would be really happy, when the last six problems get fixed.
Comment 5 Jan Wolter 2014-10-07 16:42:01 UTC
I tested the Raw Decoding settings in the Batch Queue Manager and found one error: The information "Correct false colors in highlights" under the white balance menu is not saved in the queue.xml and therefore this information could not be reloaded when you restart digikam and load an previously saved workflow.

P.S. I am working on an external script that generates a BQM-workflow from the XMP history of an manual processed image. So, I tested all tools really detailed to get the mapping between XMP history and the queue representation in the queue.xml file.
Comment 6 Jan Wolter 2014-10-21 15:42:03 UTC
I just noticed a further small problem: An image that get processed by a workflow that use the flip tool does not get an entry in the Xmp.digiKam.ImageHistory for the flip tool.
I tested this with digiKam 4.4.0. All previously reported problems are also reproducable on dk 4.4.0
Comment 7 pascalio 2014-11-08 15:42:07 UTC
OK, I confirm the bug in my batch workflows as well.
However, I guess this is more of gui bug: when I process images with a saved workflow, the result in the images is as intended, although in the BQM, the gui said it would do something wrong.
EX: 
- saved workflow = ICC converter --> sRGB.icc ...
- re-open BQM or do any of the steps described above
- BQM's gui says : ICC converter --> Apple RGB = wrong
BUT
- launch the workflow anyway --> my images get sRGB.icc as they should.

Does the same with my other tools. So not so problematic, but really confusing.
Hope it'll help !
Comment 9 caulier.gilles 2014-11-08 15:58:50 UTC
*** Bug 337689 has been marked as a duplicate of this bug. ***
Comment 10 caulier.gilles 2014-11-14 19:18:56 UTC
*** Bug 340965 has been marked as a duplicate of this bug. ***
Comment 11 Jan Wolter 2014-12-04 17:56:50 UTC
Created attachment 89831 [details]
Solves problem related to Raw Decoding in BQM

Solves the problem that "Correct false colors in hightlights" in Raw Decodings is not saved (and therefore not loaded) to queue.xml
Comment 12 Jan Wolter 2014-12-04 18:11:06 UTC
Unfortunately, my patch raises a new Bug, when I process a RAW file in the BMQ with enabled "Correct false colors in hightlights":

Thread 1 (Thread 0x7fb6e25fb840 (LWP 17927)):
[KCrash Handler]
#6  0x00007fb6dc9888c9 in QRasterWindowSurface::~QRasterWindowSurface (this=0x4d78210, __in_chrg=<optimized out>) at painting/qwindowsurface_raster.cpp:117
#7  0x00007fb6dc988949 in QRasterWindowSurface::~QRasterWindowSurface (this=0x4d78210, __in_chrg=<optimized out>) at painting/qwindowsurface_raster.cpp:121
#8  0x00007fb6dc9a0c5c in QWidgetBackingStore::~QWidgetBackingStore (this=0x4d3fcd0, __in_chrg=<optimized out>) at painting/qbackingstore.cpp:909
#9  0x00007fb6dc7d9009 in QWidgetBackingStoreTracker::destroy (this=0x4c70550) at kernel/qwidget.cpp:225
#10 0x00007fb6dc7d91a9 in QWidgetPrivate::deleteExtra (this=this@entry=0x2eb2e00) at kernel/qwidget.cpp:1833
#11 0x00007fb6dc7d93bd in QWidgetPrivate::~QWidgetPrivate (this=0x2eb2e00, __in_chrg=<optimized out>) at kernel/qwidget.cpp:365
#12 0x00007fb6dc7d9649 in QWidgetPrivate::~QWidgetPrivate (this=0x2eb2e00, __in_chrg=<optimized out>) at kernel/qwidget.cpp:370
#13 0x00007fb6dbdbc735 in cleanup (pointer=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:62
#14 ~QScopedPointer (this=0x2eb2dc8, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:100
#15 QObject::~QObject (this=0x2eb2dc0, __in_chrg=<optimized out>) at kernel/qobject.cpp:816
#16 0x00007fb6dc7e1dcc in QWidget::~QWidget (this=0x2eb2dc0, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1554
#17 0x00007fb6e01042d4 in Digikam::JPEGSettings::~JPEGSettings (this=0x2eb2dc0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/libs/dimg/loaders/jpegsettings.cpp:135
#18 0x00007fb6e010430a in Digikam::JPEGSettings::~JPEGSettings (this=0x2eb2dc0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/libs/dimg/loaders/jpegsettings.cpp:138
#19 0x000000000076b77d in Digikam::BatchTool::~BatchTool (this=0x2eb05b0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/manager/batchtool.cpp:141
#20 0x0000000000799195 in Digikam::Convert2JPEG::~Convert2JPEG (this=0x2eb05b0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/basetools/convert/convert2jpeg.cpp:56
#21 0x00000000007991c4 in Digikam::Convert2JPEG::~Convert2JPEG (this=0x2eb05b0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/basetools/convert/convert2jpeg.cpp:58
#22 0x000000000076f80c in Digikam::BatchToolsManager::~BatchToolsManager (this=0x2eb21b0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/manager/batchtoolsmanager.cpp:169
#23 0x000000000076fb76 in Digikam::BatchToolsManagerCreator::~BatchToolsManagerCreator (this=0x2eb21b0, __in_chrg=<optimized out>) at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/manager/batchtoolsmanager.cpp:91
#24 0x000000000076eee9 in destroy () at /home/jan/Downloads/digikamGIT/core/utilities/queuemanager/manager/batchtoolsmanager.cpp:98
#25 0x00000000005c3947 in KCleanUpGlobalStatic::~KCleanUpGlobalStatic (this=0xc61e80 <Digikam::._228::operator->()::cleanUpObject>, __in_chrg=<optimized out>) at /usr/include/kglobal.h:62
#26 0x00007fb6db107149 in __run_exit_handlers (status=0, listp=0x7fb6db48a6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#27 0x00007fb6db107195 in __GI_exit (status=<optimized out>) at exit.c:104
#28 0x00007fb6db0ececc in __libc_start_main (main=0x6fb8dd <main(int, char**)>, argc=5, argv=0x7fffed662bd8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffed662bc8) at libc-start.c:321
#29 0x0000000000496d09 in _start ()


Gilles, could you please test it? For me, the digiKam code is very new, so I am not familiar with it. But, I would like to learn the ropes and solve some more errors in a correct way.
Comment 13 caulier.gilles 2014-12-04 21:03:19 UTC
Your patch sound fine. Crash do not show any code from your patch. Crash still reproducible all the time ?

Gilles Caulier
Comment 14 Jan Wolter 2014-12-05 08:17:46 UTC
Yes Gilles, your are right. I tested again very detailed and the error occures (I will report and the describe this new bug immediately) even without my patch. So, I think it is save to add my patch to repository.
Comment 15 caulier.gilles 2014-12-05 08:51:52 UTC
As you have figured out some code missing in settings XML conversion engine, i certainly forget similar codes into other BQM tools. Your patch touch the common queue settings, not separated BQM tool.

In fact, Editor tools and BQM tools use common code about filter to use in a queue.
Filters are defined into core/libs/dimg/filters/

Not all filters from Editor are ported yet to BQM. See list on core/imageplugins/TODO file.

A filter define 3 parts :

- an engine to process image, as you pass an image, it processed, and a target image is provided. ex : 
- a settings container, to pass to engine to tune filter effect. This container is used by BQM to get and set from XML to settings and vis-versa. Conversion is done through BatchToolSet, BatchToolSettings, and WorkflowManager classes from BQM. To simplify, filter settings stored in container, are converted as a QMap of (QString, QVariant) pair and converted by Qt automatically to XML in Workflow manager loops. Note that XML conversion is only used in BQM, not Editor. Editor use VersionManager engine which is mostly complicated and we don't need it in BQM.
- a setttings widget which permit to BQM and Editor to show all settings in GUI.

Gilles
Comment 16 caulier.gilles 2014-12-05 08:55:02 UTC
Git commit 2cce7ede354e5796adc9487c8b6f57e8d3433613 by Gilles Caulier.
Committed on 05/12/2014 at 08:53.
Pushed by cgilles into branch 'master'.

apply patch #89831 to fix XML conversion from Raw decoding settings used in main Queue configuration

M  +8    -0    libs/dimg/drawdecoding.cpp

http://commits.kde.org/digikam/2cce7ede354e5796adc9487c8b6f57e8d3433613

diff --git a/libs/dimg/drawdecoding.cpp b/libs/dimg/drawdecoding.cpp
index b03dc1f..626b1cb 100644
--- a/libs/dimg/drawdecoding.cpp
+++ b/libs/dimg/drawdecoding.cpp
@@ -397,6 +397,10 @@ void DRawDecoding::decodingSettingsToXml(const RawDecodingSettings& prm, QDomEle
     data.setAttribute(QString::fromLatin1("value"), prm.autoBrightness);
     elm.appendChild(data);

+    data = doc.createElement(QString::fromLatin1("fixcolorshighlights"));
+    data.setAttribute(QString::fromLatin1("value"), prm.fixColorsHighlights);
+    elm.appendChild(data);
+
     data = doc.createElement(QString::fromLatin1("sixteenbitsimage"));
     data.setAttribute(QString::fromLatin1("value"), prm.sixteenBitsImage);
     elm.appendChild(data);
@@ -565,6 +569,10 @@ void DRawDecoding::decodingSettingsFromXml(const QDomElement& elm, RawDecodingSe
         {
             prm.autoBrightness = (bool)val.toInt(&ok);
         }
+        else if (key == "fixcolorshighlights")
+        {
+            prm.fixColorsHighlights = (bool)val.toInt(&ok);
+        }
         else if (key == "sixteenbitsimage")
         {
             prm.sixteenBitsImage = (bool)val.toInt(&ok);
Comment 17 Jan Wolter 2014-12-05 09:02:15 UTC
Thank you for the additional information about the software architecture. I will look at the code and try to fix the bugs. At least in January, I have some time to do it.
Comment 18 Jan Wolter 2014-12-06 16:59:15 UTC
Created attachment 89843 [details]
Solves problem with Unsharp Mask tool in BQM

With this patch the radius parameter in unsharp mask tool in BQM is not castet to int anymore.
Comment 19 caulier.gilles 2014-12-06 17:05:03 UTC
Git commit d690771168ad5496e56ecc85769ba7d6c98ee577 by Gilles Caulier.
Committed on 06/12/2014 at 17:03.
Pushed by cgilles into branch 'master'.

apply patch #89843 from Jan Wolter to fix BQM sharp tool settings conversion to XML

M  +1    -1    libs/dimg/filters/sharp/unsharpmaskfilter.cpp
M  +1    -1    utilities/queuemanager/basetools/enhance/sharpen.cpp

http://commits.kde.org/digikam/d690771168ad5496e56ecc85769ba7d6c98ee577
Comment 20 Jan Wolter 2014-12-06 22:15:48 UTC
I started to fix the problem with the resize tool, I mentiond in comment #4. I noticed that there is a similar problem with the watermark tool: the slider displays default values instead of the values defined by the user. I guess, there is a signal slot problem, but I wasn't able to solve it. I recorded an video to show the problem: https://dl.dropboxusercontent.com/u/91057768/out.ogv
The "watermark" worflow, I created before has the following value: size: 33, xMargin: 44, yMargin: 55. Before recording the video, I restarted digiKam, since the problem occurs only when digiKam is just started.
Comment 21 caulier.gilles 2014-12-07 10:32:23 UTC
Yes, it's sound like a race condition with signals/slots.

- The first stage is to identify which king of widget do not handle settings passed by workflow manager

- In second identify which methods are used in this widget to set value in widget.

- Look if this method is not call by another part which can reset value passed by workflow manager.

Using kDebug() instance much be enough to see values passed to widget.

Using debuger can be suitable to identify who call values to set it in widget. Turn on breakpoint and look backtrace (bt gdb command)

Gilles Caulier
Comment 22 DrSlony 2014-12-07 12:12:02 UTC
The watermark tool's settings are not loaded correctly.
Comment 23 Jan Wolter 2014-12-07 13:54:06 UTC
Created attachment 89859 [details]
Solves problem with local contrast tool

Solves the problem that all "Power" and "Blur" parameters are set to 0 after loading. The local contrast BQ tool expects double values for power and blur, but the container stores them as float. With this patch, it works as expected.

P.S. Thanks for your explanation regarded race condition with signals/slots. I will try to fix it.
Comment 24 caulier.gilles 2014-12-07 15:23:09 UTC
Thanks Jan to help us.

We are very busy to port digiKam to Qt5, and it's very important to maintain KDE4 code until next major release will be published.

More details can be seen here :

https://techbase.kde.org/Projects/Digikam/CodingSprint2014#KDE_Framework_Port

Gilles Caulier
Comment 25 caulier.gilles 2014-12-07 15:29:32 UTC
Git commit c23d85f02365b3c27d1d38c914d5e2aeb13e7e98 by Gilles Caulier.
Committed on 07/12/2014 at 15:28.
Pushed by cgilles into branch 'master'.

Apply patch #89859 from JAn Wolter to fix Local Contrast tool settings conversion from/to XML for BQM workflow

M  +2    -2    libs/dimg/filters/lc/localcontrastcontainer.cpp
M  +4    -4    libs/dimg/filters/lc/localcontrastcontainer.h

http://commits.kde.org/digikam/c23d85f02365b3c27d1d38c914d5e2aeb13e7e98
Comment 26 caulier.gilles 2014-12-08 09:08:18 UTC
yes, exactly, digiKam 5.0.0.

We will continue to release 4.7.0, 4.8.0, etc... each week as bugfixes release. If we branch digiKam core after 4.6.0 to start Qt5 port, this want mean to sync both branches (master and frameworks). If patch applied to master are not too intrusive, this will be easy, else... This is why only bugfixes must be apply to 4.x series, no news features.

Porting all shared libs is done. Kipi-plugins will be long, but at least few plugins are there to test.

digiKam core will be long, due to large regression tests to do.

Gilles
Comment 27 Jan Wolter 2014-12-10 18:23:30 UTC
Created attachment 89911 [details]
Patch solves problem with iccConvert tool

This patch solves the problem mentioned in comment #7 by pascalio.
The problem occured because slotAssignSettings2Widget was not registered which happens in BatchTool::registerSettingsWidget().
Furthermore, there was a small issue with the default profile. Now, the profile on index 0 (instead of undefined index -1) in comboBox is selected.
Comment 28 caulier.gilles 2014-12-10 21:45:28 UTC
Git commit 93fc881698d36a70eba1fd1749ef851574d0d2df by Gilles Caulier.
Committed on 10/12/2014 at 21:43.
Pushed by cgilles into branch 'master'.

apply patch #89911 from Jan Wolter to solves problem with BQM IccConvert tool about settings management with workflow
Related: bug 333929
FIXED-IN: 4.6.0

M  +2    -1    NEWS
M  +1    -1    libs/dimg/filters/icc/iccprofilesettings.cpp
M  +2    -0    utilities/queuemanager/basetools/color/iccconvert.cpp

http://commits.kde.org/digikam/93fc881698d36a70eba1fd1749ef851574d0d2df
Comment 29 DrSlony 2014-12-10 21:49:17 UTC
Thank you for fixing this, hope it fixes the watermark position and offset and JPEG chroma subsampling values too.
Comment 30 Jan Wolter 2014-12-11 12:14:15 UTC
(In reply to Gilles Caulier from comment #15)
> A filter define 3 parts :
> 
> - an engine to process image, as you pass an image, it processed, and a
> target image is provided. ex : 
> - a settings container, to pass to engine to tune filter effect. This
> container is used by BQM to get and set from XML to settings and vis-versa.
> Conversion is done through BatchToolSet, BatchToolSettings, and
> WorkflowManager classes from BQM. To simplify, filter settings stored in
> container, are converted as a QMap of (QString, QVariant) pair and converted
> by Qt automatically to XML in Workflow manager loops. Note that XML
> conversion is only used in BQM, not Editor. Editor use VersionManager engine
> which is mostly complicated and we don't need it in BQM.
> - a setttings widget which permit to BQM and Editor to show all settings in
> GUI.

I took a more global view on the implementation of the image filters. I noticed that the stratefy based on a settings and container implementation (in libs/dimg/filters/) is not used in the same manner for all filters. In the settings code the GUI is implemented, which is used by batch queue tools (in utilities/queuemanager/basetools/) and from the editor tools (in imageplugins/). The container implementations are only used to communicate with BQM.

But I noticed that there are only containers for 4 tools: local contrast, white balance, curves, and icc. But more surprising was for me that not all tools share a common settings implementation. For example, the resize tool has a completely different implementation in the image editor (imageplugins/transform/resizetool.cpp) than in the batch queue manager (utilities/queuemanager/basetools/transform/resize.cpp). Gilles, could you please explain these differences?

By the way, first I will fix the remaining problems mentioned in this bug report. But I tooks this look ti see how much work it would be to port the remaing tools (imageplugins/TODO) to BQM.
Comment 31 caulier.gilles 2014-12-11 12:38:43 UTC
Jan,

The difference about filters shared between IE and BQM are due to missing time to factoring code.

BQM is come  later than IE. Filters have been implemented for IE first. Now step by step, BQM will use same filter than IE, if it's possible.

I resume all difference in this file :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/imageplugins/TODO

Look "Port to BQM" column.

But file is incomplete. If you look into resizetool, BQM port implement just few features, not whole Editor tool. Look into bugzilla, there are reports about this problem.

Also, some filters have settings container or not. This depend of complexity of filters (especially when settings structure is huge).

Ideally, all filters must use the same framework base, but it's not the case... due to time missing to implement it, and too much work to follow with students.

Gilles
Comment 32 Jan Wolter 2014-12-11 13:17:24 UTC
Created attachment 89917 [details]
I forgot to fix one line related to icc default profile
Comment 33 caulier.gilles 2014-12-11 13:49:04 UTC
Git commit be04a8d3befdd99fbabad00b9f4e2b1dc51a8d00 by Gilles Caulier.
Committed on 11/12/2014 at 13:48.
Pushed by cgilles into branch 'master'.

apply patch #89917

M  +1    -1    libs/dimg/filters/icc/iccprofilesettings.cpp

http://commits.kde.org/digikam/be04a8d3befdd99fbabad00b9f4e2b1dc51a8d00
Comment 35 caulier.gilles 2015-01-24 09:46:23 UTC
Jan,

Any progress here ? 4.7.0 will be released next Sunday evening...

Best

Gilles Caulier
Comment 36 Jan Wolter 2015-01-24 16:15:10 UTC
Hi Gilles,
the last weeks I had much time to improve BQM; so there is no progress.
Bests,
Jan
Comment 37 Maik Qualmann 2015-02-05 22:19:20 UTC
Created attachment 90932 [details]
bqm.patch

This patch fixed the missing / incorrect values of BQM tools from Comment 34.
Comment 38 caulier.gilles 2015-02-06 07:30:12 UTC
Git commit 64470d96cf2103125b61b509de8520505cfba498 by Gilles Caulier.
Committed on 06/02/2015 at 07:27.
Pushed by cgilles into branch 'master'.

Apply patch #90932 from MAik Qualmann to fix values storage from BQM tools workflow
FIXED-IN: 4.8.0

M  +2    -1    NEWS
M  +10   -4    utilities/queuemanager/basetools/convert/convert2jpeg.cpp
M  +1    -0    utilities/queuemanager/basetools/convert/convert2jpeg.h
M  +25   -19   utilities/queuemanager/basetools/decorate/watermark.cpp
M  +1    -0    utilities/queuemanager/basetools/metadata/assigntemplate.cpp
M  +14   -6    utilities/queuemanager/basetools/transform/resize.cpp

http://commits.kde.org/digikam/64470d96cf2103125b61b509de8520505cfba498
Comment 39 caulier.gilles 2015-02-06 07:49:14 UTC
Git commit 5e206298092ed97391a8b6de1d08ffb7123d6bb8 by Gilles Caulier.
Committed on 06/02/2015 at 07:47.
Pushed by cgilles into branch 'frameworks'.

backport commit #64470d96cf2103125b61b509de8520505cfba498 from git/master to framework branch

M  +10   -4    utilities/queuemanager/basetools/convert/convert2jpeg.cpp
M  +1    -0    utilities/queuemanager/basetools/convert/convert2jpeg.h
M  +24   -20   utilities/queuemanager/basetools/decorate/watermark.cpp
M  +1    -0    utilities/queuemanager/basetools/metadata/assigntemplate.cpp
M  +14   -6    utilities/queuemanager/basetools/transform/resize.cpp

http://commits.kde.org/digikam/5e206298092ed97391a8b6de1d08ffb7123d6bb8
Comment 40 Jan Wolter 2015-02-06 09:13:40 UTC
(In reply to Jan Wolter from comment #36)
> the last weeks I had much time to improve BQM; so there is no progress.

Of course, I wanted to say that I had NOT much time. Unfortunately, for the nexts weeks I have a lot of work, too. But its great that Maik started to fix some bugs here!