Bug 158174 - precise aspect ratio crop feature
Summary: precise aspect ratio crop feature
Alias: None
Product: digikam
Classification: Unclassified
Component: Plugin-Editor-Crop (show other bugs)
Version: 4.9.0
Platform: Compiled Sources Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Digikam Developers
Depends on:
Reported: 2008-02-21 17:58 UTC by Roberto Castagnola
Modified: 2016-06-29 19:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.4

ratiocrop-precisecrop.patch (23.30 KB, patch)
2008-02-21 18:06 UTC, Roberto Castagnola

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Castagnola 2008-02-21 17:58:40 UTC
Version:            (using KDE 3.5.8)
Installed from:    Compiled From Sources

Next attached patch adds a precise ratio crop feature as suggested by Arnd (Bug 128293 Comment #12).
Comment 1 Roberto Castagnola 2008-02-21 18:06:51 UTC
Created attachment 23652 [details]

- new option to force a precise aspect ratio crop.
- reuse code from applyAspectRatio function when drawing a symmetric selection
with mouse, thus computeAspectRatio function is no more needed.
- few more comments added to code.

Arnd, does it work as you thought?
Comment 2 Arnd Baecker 2008-02-21 20:06:41 UTC
SVN commit 777847 by abaecker:

When using the aspect ratio crop, it is now possible to ensure that the
aspect ratio is fulfilled exactly. This is done by only allowing
those combinations of width/heights which lead to the correct aspect ratio
(thanks to Roberto Castagnola who wrote the patch).

CCBUGS: 158174

 M  +3 -1      NEWS  
 M  +25 -4     imageplugins/coreplugin/ratiocrop/imageeffect_ratiocrop.cpp  
 M  +2 -0      imageplugins/coreplugin/ratiocrop/imageeffect_ratiocrop.h  
 M  +138 -170  imageplugins/coreplugin/ratiocrop/imageselectionwidget.cpp  
 M  +7 -2      imageplugins/coreplugin/ratiocrop/imageselectionwidget.h  

WebSVN link: http://websvn.kde.org/?view=rev&revision=777847
Comment 3 caulier.gilles 2008-02-21 20:19:29 UTC
Roberto, thanls again for this patch...

Arnd, this file is not yet closed...


Comment 4 caulier.gilles 2008-02-21 20:21:29 UTC

I'm stupid (:=))). It's not yet closed because the code is not yet ported to KDE4...

Sorry for the sound (:=)))

Comment 5 Arnd Baecker 2008-02-21 22:40:38 UTC

everything works perfect in all the cases I checked.
Thanks a lot for your patch, it is very much appreciated!!

Best wishes,

Comment 6 caulier.gilles 2008-03-14 12:31:36 UTC
SVN commit 785562 by cgilles:

digiKam from trunk (KDE4) : Ratio crop tool : backport commit #777847 from KDE3 branch
CCBUGS: 158174

 M  +27 -6     imageeffect_ratiocrop.cpp  
 M  +2 -0      imageeffect_ratiocrop.h  
 M  +140 -171  imageselectionwidget.cpp  
 M  +9 -4      imageselectionwidget.h  

WebSVN link: http://websvn.kde.org/?view=rev&revision=785562
Comment 7 caulier.gilles 2008-03-14 12:45:16 UTC

Your patch have been ported to KDE4 implementation.

But i recommend to test if all work fine for you. Your patch is huge and i hope to not have forget something (:=)))

Thanks in advance

Gilles Caulier
Comment 8 caulier.gilles 2008-03-14 12:54:30 UTC
Screenshot of Showfoto for KDE4 running Ratio Crop tool using "Desert" color scheme theme: 


This rock no ???

Gilles Caulier
Comment 9 Mikolaj Machowski 2008-03-14 23:32:55 UTC
> This rock no ???

Yes, it rocks :)
Comment 10 Roberto Castagnola 2008-03-15 11:27:36 UTC
It's a PITA for me to download it with svn at home using 56K modem, and I don't know how to download it at work using windows. Is there any kde4 port snapshot available?
Comment 11 caulier.gilles 2008-03-15 14:31:18 UTC

Yes, there are daily snapshot created automatically by a script hosted by KDE. Look here :


Comment 12 Roberto Castagnola 2008-03-15 15:24:32 UTC

I will hopefully try it next week, thanks.
Comment 13 caulier.gilles 2008-03-20 14:53:08 UTC
Code is now backported to KDE4. I close this file.