Bug 301048 - BQM Watermark tool : more super-impose visible watermark options [patch]
Summary: BQM Watermark tool : more super-impose visible watermark options [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Bqm-WaterMark (show other bugs)
Version: 2.5.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-02 11:48 UTC by Axel Krebs
Modified: 2017-02-21 13:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.5.0


Attachments
distributed watermark (as with google) (91.20 KB, image/jpeg)
2012-06-02 11:50 UTC, Axel Krebs
Details
water mark repetition and random placement patch (21.56 KB, patch)
2017-02-16 09:35 UTC, Ahmed Fathi
Details
the patch (21.56 KB, patch)
2017-02-16 09:38 UTC, Ahmed Fathi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Krebs 2012-06-02 11:48:24 UTC
digikam offers "add watermark" as an option in batch queue manager. 

One can choose, if watermark is a picture or a text.

Additionally, it is possible to select a position

Advantage: it is much less likely, that someone discards a distributed wm than a single one.

Reproducible: Always

Steps to Reproduce:
1. start digikam
2. run batch queue manager
3. add watermark
Actual Results:  
the user is forced to select a specific position of a watermark. 

Expected Results:  
I suggest to add an additional option to position a watermark: 

1.) variation: distributed watermark (="wm"), where wm's are positioned in soem type of pattern regularly

2.) varation: randomly distributed watermark without a possibility to position the wm itself.

In both cases: the larger the pic, the more copies of wm's are added.

QUESTION: 

Why ist it _NOT_ possible to add a file simply when reporting a bug?
If commending a bug, it is possible very easy!?!?!?
Comment 1 Axel Krebs 2012-06-02 11:50:01 UTC
Created attachment 71509 [details]
distributed watermark (as with google)
Comment 2 Ahmed Fathi 2017-02-16 09:35:33 UTC
Created attachment 104050 [details]
water mark repetition and random placement patch

I created this patch. now you can repeat the water mark in a systematic pattern or in a random pattern. you have both dense and sparse modes , and you can put custom sparsity parameter as you need. It works well with the four different rotations also. In addition , in the randomized placement mode , you can choose to randomize the orientation of the watermark also , or constraint the "randomness" to be the randomness of position only while the rotation is as chosen via the combo box
Comment 3 Ahmed Fathi 2017-02-16 09:38:43 UTC
Created attachment 104051 [details]
the patch

forgot to mark it as patch
Comment 4 caulier.gilles 2017-02-20 07:04:46 UTC
Ahmed,

Patch do not compile :

/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp: In constructor ‘Digikam::WaterMark::Private::Private()’:
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:127:22: warning: ‘Digikam::WaterMark::Private::useTextRadioButton’ will be initialized after [-Wreorder]
     QRadioButton*    useTextRadioButton;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:124:22: warning:   ‘QCheckBox* Digikam::WaterMark::Private::useBackgroundCheckBox’ [-Wreorder]
     QCheckBox*       useBackgroundCheckBox;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:89:5: warning:   when initialized here [-Wreorder]
     Private() :
     ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:133:22: warning: ‘Digikam::WaterMark::Private::placementPositionComboBox’ will be initialized after [-Wreorder]
     QComboBox*       placementPositionComboBox;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:132:22: warning:   ‘QComboBox* Digikam::WaterMark::Private::placementTypeComboBox’ [-Wreorder]
     QComboBox*       placementTypeComboBox;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:89:5: warning:   when initialized here [-Wreorder]
     Private() :
     ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:135:22: warning: ‘Digikam::WaterMark::Private::sparsityFactorSpinBox’ will be initialized after [-Wreorder]
     QDoubleSpinBox * sparsityFactorSpinBox;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:134:22: warning:   ‘QComboBox* Digikam::WaterMark::Private::rotationComboBox’ [-Wreorder]
     QComboBox*       rotationComboBox;
                      ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:89:5: warning:   when initialized here [-Wreorder]
     Private() :
     ^
In file included from /usr/lib64/qt5/include/QtGui/qfont.h:38:0,
                 from /usr/lib64/qt5/include/QtGui/QFont:1,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.h:31,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:26:
/usr/lib64/qt5/include/QtCore/qstring.h: In member function ‘virtual void Digikam::WaterMark::registerSettingsWidget()’:
/usr/lib64/qt5/include/QtCore/qstring.h:788:5: error: ‘QString::QString(const char*)’ is private
     QString(const char *ch);
     ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:322:177: error: within this context
     d->denseRepetitionCheckBox->setWhatsThis("When you choose to have the watermark repeated many times in the placement combo box, you can specify here whether the repetition");
                                                                                                                                                                                 ^
In file included from /usr/lib64/qt5/include/QtGui/qfont.h:38:0,
                 from /usr/lib64/qt5/include/QtGui/QFont:1,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.h:31,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:26:
/usr/lib64/qt5/include/QtCore/qstring.h:788:5: error: ‘QString::QString(const char*)’ is private
     QString(const char *ch);
     ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:336:126: error: within this context
                                                "you can check this to make the watermark rotations random also[0,90,180,270]");
                                                                                                                              ^
In file included from /usr/lib64/qt5/include/QtGui/qfont.h:38:0,
                 from /usr/lib64/qt5/include/QtGui/QFont:1,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.h:31,
                 from /home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:26:
/usr/lib64/qt5/include/QtCore/qstring.h:788:5: error: ‘QString::QString(const char*)’ is private
     QString(const char *ch);
     ^
/home/gilles/Devel/5.x/core/utilities/queuemanager/tools/decorate/watermark.cpp:356:103: error: within this context
                                            " typically between 1.0 and 3.0. can also be less than 1.0");
                                                                                                       ^
core/utilities/queuemanager/CMakeFiles/queuemanager_src.dir/build.make:518: recipe for target 'core/utilities/queuemanager/CMakeFiles/queuemanager_src.dir/tools/decorate/watermark.cpp.o' failed
make[2]: *** [core/utilities/queuemanager/CMakeFiles/queuemanager_src.dir/tools/decorate/watermark.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

-----

In source code i18n(" ") must be replaced by QLatin1String(" ")
Fix also indentation and alignment (coding style).
I suspect also a broken braken in last function.

Did you compile this code on your computer ?

Gilles Caulier
Comment 5 Ahmed Fathi 2017-02-20 08:43:40 UTC
strange . It compiles and works perfectly well on my computer. I also reset the branch, pulled the master , and re-applied the same patch file and it compiled without any problems.
Comment 6 caulier.gilles 2017-02-20 09:06:51 UTC
Here digiKam is compiled with pure Qt5. No extra KDE4LibsSupport typicially introduced if you compile digiKam with KCalCore support or another KDE desktop dependencies.

Check these points : KF5::AkonadiContact, KF5::FileMetaData, KF5::CalendarCore

https://cgit.kde.org/digikam-software-compilation.git/tree/DEPENDENCIES

Gilles Caulier
Comment 7 caulier.gilles 2017-02-21 13:08:52 UTC
Git commit 65ef15bb4d6deb4b91d22016f47b88716dfa93ba by Gilles Caulier.
Committed on 21/02/2017 at 13:06.
Pushed by cgilles into branch 'master'.

apply patch #104050 from Ahmed Fathi to perform Watermark repetition and random placement.
port patch to pure Qt5
FIXED-IN: 5.5.0

M  +2    -1    NEWS
M  +216  -67   utilities/queuemanager/tools/decorate/watermark.cpp

https://commits.kde.org/digikam/65ef15bb4d6deb4b91d22016f47b88716dfa93ba