Bug 279216 - "Resize image" feature is missing some useful options [patch]
Summary: "Resize image" feature is missing some useful options [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-Resize (show other bugs)
Version: 4.0.0
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 21:25 UTC by Kamil Stepinski
Modified: 2019-04-15 17:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0


Attachments
This patch solves the current bug as I've added a preset resolution list. (7.14 KB, patch)
2019-02-12 14:49 UTC, Sambhav Dusad
Details
Changed the wrong code and added more functionality. (11.63 KB, patch)
2019-02-12 21:33 UTC, Sambhav Dusad
Details
attachment-19246-0.html (1.76 KB, text/html)
2019-02-13 20:18 UTC, Sambhav Dusad
Details
Units are changed to radio buttons and Aspect Ratio Preserve checkbox added. (9.96 KB, patch)
2019-02-14 12:50 UTC, Sambhav Dusad
Details
Preserve Aspect Ratio by width or height added. (19.97 KB, patch)
2019-02-17 21:49 UTC, Sambhav Dusad
Details
Added preset resolutions to the editor resize plugin. (11.10 KB, patch)
2019-02-19 19:26 UTC, Sambhav Dusad
Details
This patch adds different units like cm, inches, mm for image resizing. (20.10 KB, patch)
2019-02-23 21:50 UTC, Sambhav Dusad
Details
This patch adds combobox for units. user can also change resolution of the image in pixel/inch (27.28 KB, patch)
2019-03-23 17:23 UTC, Sambhav Dusad
Details
When changing units, previous value should be kept. (29.43 KB, patch)
2019-03-28 15:07 UTC, Sambhav Dusad
Details
Adds all the needed functionality in editor resize patch. (29.54 KB, patch)
2019-03-29 18:02 UTC, Sambhav Dusad
Details
Adds all the needed functionality in editor resize patch. (30.29 KB, patch)
2019-04-09 11:27 UTC, Sambhav Dusad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kamil Stepinski 2011-08-02 21:25:11 UTC
Version:           2.0.0 (using KDE 4.5.5) 
OS:                Linux

digiKam -> Image Editor -> Resize
When I work on a number of photos for my web gallery I always resize them to a lower resolution before retouching and uploading. I repeat the "resize" operation for every photo I process and I always have to manually enter the size of the photo (width: 1280 for example) and click the OK button. It would really simplify and speed up my processing if there were some (configurable) buttons added below the 4 sliders allowing you to select some predefined (and most used) settings (image resolutions).
The image tells one thousand words - so I'm attaching a link to the screenshot of the "resize image" option in IrfanView image viewer (windows only). The second columns allows you to select some (hardcoded) resolutions.
It would be great if digiKam had a few of such buttons so I wouldn't have to type the resolution every time I work on 50 photos from one photoshoot.
Batch processing resize won't work for me as I usually crop the photo before resizing.
This should be a trivial thing to implement and in my opinion would add to usability of digiKam.
Thank you.

(the rescaling of the image by percentage option might also be a good idea for implementation)


IrfanView resize option screenshot:
http://jimcoles.files.wordpress.com/2009/07/irfanview-resize-resample.jpg?w=492&h=368

Reproducible: Always



Expected Results:  
Additional buttons with some most used (user configurable) resolutions.
Comment 1 Sambhav Dusad 2019-02-06 06:20:14 UTC
I agree with you and I think we can implement some new features like

1. Giving options to users to select from some pre-defined dimensions.
2. Users can have their own set of dimensions which they use frequently.
3. Having other units as well for resizing like cm and inches.
Comment 2 Sambhav Dusad 2019-02-12 14:49:21 UTC
Created attachment 118003 [details]
This patch solves the current bug as I've added a preset resolution list.

Now the user can select any one of the resolutions and resize the image.
Comment 3 Sambhav Dusad 2019-02-12 21:33:30 UTC
Created attachment 118016 [details]
Changed the wrong code and added more functionality.

The user can now choose from pixel, percent, cms, and inches as image units.
Comment 4 caulier.gilles 2019-02-13 11:57:57 UTC
Git commit 65d063b749c66fdf012581b70e4bf7fe2c7186b8 by Gilles Caulier.
Committed on 13/02/2019 at 11:56.
Pushed by cgilles into branch 'development/dplugins'.

BQM resize tool: apply patch #118016 from Sambhav Dusad to add advanced settings.

M  +4    -693  NEWS
M  +128  -24   core/dplugins/bqm/transform/resize/resize.cpp
M  +3    -0    core/dplugins/bqm/transform/resize/resizeplugin.cpp
C  +0    -1    project/NEWS.6.0.0 [from: NEWS - 099% similarity]

https://commits.kde.org/digikam/65d063b749c66fdf012581b70e4bf7fe2c7186b8
Comment 5 Maik Qualmann 2019-02-13 20:16:24 UTC
Hi Sambhav,

please check the enabled state. If percent or centimeters are used, the other CheckBox must be disabled. Or use a QRadioButton group. Also, the value slider must be enabled if only percent or centimeter is checked.

Maik
Comment 6 Sambhav Dusad 2019-02-13 20:18:44 UTC
Created attachment 118052 [details]
attachment-19246-0.html

Yeah, I already changed it and added radiobuttons.
I was modifying the code more. So, thought of submitting the patch later

Best,
Sambhav Dusad

On Thu 14 Feb, 2019, 01:46 Maik Qualmann, <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=279216
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |metzpinguin@gmail.com
>    Version Fixed In|                            |6.1.0
>
> --- Comment #5 from Maik Qualmann <metzpinguin@gmail.com> ---
> Hi Sambhav,
>
> please check the enabled state. If percent or centimeters are used, the
> other
> CheckBox must be disabled. Or use a QRadioButton group. Also, the value
> slider
> must be enabled if only percent or centimeter is checked.
>
> Maik
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 7 Sambhav Dusad 2019-02-14 12:50:22 UTC
Created attachment 118067 [details]
Units are changed to radio buttons and Aspect Ratio Preserve checkbox added.

QGridLayout is used to style the items.
Comment 8 caulier.gilles 2019-02-14 13:40:23 UTC
Git commit 8689c3e549e3749547cde4b65f5e2f9c011f35f8 by Gilles Caulier.
Committed on 14/02/2019 at 13:39.
Pushed by cgilles into branch 'development/dplugins'.

apply patch #118067

M  +72   -48   core/dplugins/bqm/transform/resize/resize.cpp

https://commits.kde.org/digikam/8689c3e549e3749547cde4b65f5e2f9c011f35f8
Comment 9 Maik Qualmann 2019-02-14 21:13:59 UTC
Hi Sambhav,

I polished the code of the resize BQM plugin a bit. I noticed that the function "Use Pixels" does not work. Please look again at the code and check all options.

Maik
Comment 10 Sambhav Dusad 2019-02-17 21:49:38 UTC
Created attachment 118166 [details]
Preserve Aspect Ratio by width or height added.

The sliders are enabled even when Use Custom is not checked.
Sorry for the inconvenience.
Comment 11 Sambhav Dusad 2019-02-19 19:26:23 UTC
Created attachment 118202 [details]
Added preset resolutions to the editor resize plugin.
Comment 12 Sambhav Dusad 2019-02-23 21:50:09 UTC
Created attachment 118326 [details]
This patch adds different units like cm, inches, mm for image resizing.

It also adds preset resolution combobox to image editor resize plugin.
Comment 13 Sambhav Dusad 2019-03-23 17:23:12 UTC
Created attachment 118984 [details]
This patch adds combobox for units. user can also change resolution of the image in pixel/inch
Comment 14 Sambhav Dusad 2019-03-28 15:07:48 UTC
Created attachment 119102 [details]
When changing units, previous value should be kept.

But I can't access d->wInput->value() OR d->hInput->value() from slotUnitsChanged. And I can access d->resolution->value() from the same slot.

Where am I doing wrong?

Thanks
Comment 15 Sambhav Dusad 2019-03-29 18:02:02 UTC
Created attachment 119127 [details]
Adds all the needed functionality in editor resize patch.

I think this patch resolves all the previous errors. Please review it.
Thanks for all the suggestions.
Comment 16 Maik Qualmann 2019-04-07 07:05:51 UTC
- When entering cm / mm / inch, it must be possible to enter decimal digits.
- The range limits vary and are not set correctly when the units are changed.
- When the units are changed, the result is constantly changing due to rounding errors and because no decimal digits are supported.

Maik
Comment 17 Sambhav Dusad 2019-04-09 11:27:48 UTC
Created attachment 119317 [details]
Adds all the needed functionality in editor resize patch.

I have modified the previous patch and this should solve all the previous errors or rounding and decimal places.
Comment 18 Maik Qualmann 2019-04-15 17:30:44 UTC
Git commit fc620b3a5766ba4e5085a99da33839c82139470c by Maik Qualmann.
Committed on 15/04/2019 at 17:29.
Pushed by mqualmann into branch 'master'.

apply patch #119317 from Sambhav Dusad to add features to the resize tool

M  +2    -1    NEWS
M  +455  -46   core/dplugins/editor/transform/resize/resizetool.cpp
M  +4    -0    core/dplugins/editor/transform/resize/resizetool.h

https://commits.kde.org/digikam/fc620b3a5766ba4e5085a99da33839c82139470c
Comment 19 Maik Qualmann 2019-04-15 17:33:15 UTC
Git commit fe9d5f511d0c4c1083c0c1e6b0c6f37f2ab91b1d by Maik Qualmann.
Committed on 15/04/2019 at 17:32.
Pushed by mqualmann into branch 'master'.

polish und corrections on resize tool
FIXED-IN: 6.2.0

M  +247  -291  core/dplugins/editor/transform/resize/resizetool.cpp
M  +4    -3    core/dplugins/editor/transform/resize/resizetool.h

https://commits.kde.org/digikam/fe9d5f511d0c4c1083c0c1e6b0c6f37f2ab91b1d