Bug 313938

Summary: Workflow doesn't save/restore tool parameters
Product: digikam Reporter: Matthias Welwarsky <matze>
Component: BatchQueueManager-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: caulier.gilles, mnaugendre
Priority: NOR    
Version: 3.1.0   
Target Milestone: ---   
Platform: openSUSE RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 3.2.0

Description Matthias Welwarsky 2013-01-26 21:50:49 UTC
When assigning a workflow to a queue, only the tools and their order are restored. The tool parameters are not restored.

Reproducible: Always

Steps to Reproduce:
1. Set up a tool chain in BQM, save it as workflow
2. Remove the tool chain
3. Assign the workflow to the current queue
Actual Results:  
The tools are restored and assigned to the queue. The tool parameters are not restored

Expected Results:  
Tools are restored in save order and with the correct parameters

compiled from source on Friday 25th using the then latest git revisions
Comment 1 mnaugendre 2013-03-21 11:09:36 UTC
Using 3.0.0 version, I can confirm that no parameter is saved, and the defaults that appear after a "somewhat-restoration" don't allow a valid treatment:
 - dimension: size is 10pixels
 - watermark: the filename is set to "true"
 - JPEG quality is 1
Comment 2 caulier.gilles 2013-03-21 14:55:47 UTC
Git commit 4cb98b4fbbbbfeedfef03cb6cc7b5ec5b6c72434 by Gilles Caulier.
Committed on 21/03/2013 at 15:53.
Pushed by cgilles into branch 'master'.

Fix wrong QVaviant cast when Workflow is restaured from settings XML file

M  +7    -1    utilities/queuemanager/manager/workflowmanager.cpp

http://commits.kde.org/digikam/4cb98b4fbbbbfeedfef03cb6cc7b5ec5b6c72434
Comment 3 caulier.gilles 2013-03-21 15:02:27 UTC
Marie Noelle,

As you use current implementation from git/master, you can test my last commit where i fixed a stupid cast when Workflow value are loaded from XML settings file.

Workflow are saved in your home directory at this place :

~/.kde4/share/apps/digikam/queue.xml

You can open this file with a simple text editor and look if settings parameter is saved properly for all tool from your workflow. The structure of this XML is not complicated to understand.

Note : it's possible that previous data saved in this file before this fix are corrupted. Check before. If you have a doubt, purge it and recreate your workflow settings.

Gilles Caulier
Comment 4 mnaugendre 2013-03-21 15:29:12 UTC
Here is an excerpt of the file :
       <tool>
            <toolname value="Resize"/>
            <toolgroup value="5"/>
            <index value="0"/>
            <version value="1"/>
            <parameter type="int" value="1024" name="LengthCustom"/>
            <parameter type="int" value="3" name="LengthPreset"/>
            <parameter type="bool" value="false" name="UseCustom"/>
        </tool>
        <tool>
            <toolname value="Sharpen"/>
            <toolgroup value="4"/>
            <index value="1"/>
            <version value="1"/>
            <parameter type="double" value="0.5" name="RefocusCorrelation"/>
            <parameter type="double" value="0" name="RefocusGauss"/>
            <parameter type="int" value="5" name="RefocusMatrixSize"/>
            <parameter type="double" value="0.03" name="RefocusNoise"/>
            <parameter type="double" value="1" name="RefocusRadius"/>
            <parameter type="int" value="0" name="SharpenFilterType"/>
            <parameter type="int" value="3" name="SimpleSharpRadius"/>
            <parameter type="double" value="1" name="UnsharpMaskAmount"/>
            <parameter type="double" value="1" name="UnsharpMaskRadius"/>
            <parameter type="double" value="0.05" name="UnsharpMaskThreshold"/>
        </tool>
        <tool>
            <toolname value="WaterMark"/>
            <toolgroup value="6"/>
            <index value="2"/>
            <version value="1"/>
            <parameter type="QColor" value="#cccccc" name="Background color"/>
            <parameter type="int" value="100" name="Background opacity"/>
            <parameter type="QColor" value="#000000" name="Color"/>
            <parameter type="QFont" value="Sans Serif,10,-1,5,50,0,0,0,0,0" name="Font"/>
            <parameter type="int" value="2" name="Placement"/>
            <parameter type="QString" value="" name="Text"/>
            <parameter type="int" value="100" name="Text opacity"/>
            <parameter type="bool" value="true" name="Use background"/>
            <parameter type="bool" value="true" name="Use image"/>
            <parameter type="QString" value="/home/marie-noelle/Documents/Photographe-Auteur/Visuels/2013/logo/logo-V2-filigrane500.png" name="Watermark image"/>
            <parameter type="int" value="15" name="Watermark size"/>
            <parameter type="int" value="1" name="X margin"/>
            <parameter type="int" value="1" name="Y margin"/>
        </tool>
        <tool>
            <toolname value="Convert2JPEG"/>
            <toolgroup value="8"/>
            <index value="3"/>
            <version value="1"/>
            <parameter type="int" value="90" name="Quality"/>
            <parameter type="int" value="0" name="SubSampling"/>
        </tool>

I don't understand every parameter, but my watermark filename is right, JPEG conversion quality is '90' as it should be, resize seems to be '1024' as it put it; but when I choose 'assign workflow to the current queue' I don't get these values!
Comment 5 caulier.gilles 2013-03-21 15:55:48 UTC
Are you sure to have done a "git pull" in digiKam and recompiled/installed it ?

When updating source code, you must have something like this :

[gilles@localhost core]$ pwd
/mnt/devel/GIT/3.x/core
[gilles@localhost core]$ git pull
remote: Counting objects: 90, done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 44 (delta 39), reused 0 (delta 0)
Unpacking objects: 100% (44/44), done.
From git.kde.org:digikam
   fb44159..4cb98b4  master     -> origin/master
   6e2c02a..306ccff  libkface   -> origin/libkface
   d0719a4..c5dae13  picassafacetag -> origin/picassafacetag
Updating fb44159..4cb98b4
Fast-forward
 utilities/queuemanager/main/queuemgrwindow.cpp     |    3 +++
 utilities/queuemanager/manager/batchtoolutils.cpp  |   11 +++++++++++
 utilities/queuemanager/manager/batchtoolutils.h    |    3 +++
 utilities/queuemanager/manager/workflowmanager.cpp |   16 ++++++++++++++--
 utilities/queuemanager/manager/workflowmanager.h   |    5 +++--
 5 files changed, 34 insertions(+), 4 deletions(-)
[gilles@localhost core]$

Gilles Caulier
Comment 6 caulier.gilles 2013-03-22 11:12:23 UTC
Marie Noelle or Mathias,

I cannot reproduce bug now since my last commit in git/master. Can you confirm ?

Gilles Caulier
Comment 7 Matthias Welwarsky 2013-03-22 12:21:02 UTC
Gilles,
for me your commit fixes the bug.
thanks a lot
Comment 8 caulier.gilles 2013-03-22 12:31:47 UTC
Thanks Mathias

Gilles Caulier
Comment 9 Matthias Welwarsky 2013-04-22 16:26:25 UTC
I did further checking and found that some tools are not properly restored:
- 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

Reopen or create new bug?
Comment 10 caulier.gilles 2013-04-22 16:32:17 UTC
Hi Matthias,

Please create a new entry. I will fix it before 3.2.0

Gilles