Bug 210874 - Wish for new option in resize-tool: fit into given dimensions
Summary: Wish for new option in resize-tool: fit into given dimensions
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Bqm-Resize (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-17 13:00 UTC by Stefan Hühne
Modified: 2018-03-23 11:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hühne 2009-10-17 13:00:49 UTC
Version:           1.0.0beta5 (using KDE 4.3.2)
OS:                Linux
Installed from:    SuSE RPMs

I would like to be able to resize images so they fit into a given frame while retaining their aspect ratio - like imagemagick's resize. 
Example original size       fitted to 10000*500 
         1000*1000           500*500
        10000*1000          5000*500
          500*1000           250*500

Stefan
Comment 1 Johannes Wienke 2009-10-17 20:33:50 UTC
Isn't this what is already possible with the 2dim resize tool?
Comment 2 Stefan Hühne 2009-10-18 12:11:49 UTC
No. This is my experience.
Using 2dim-resize to 10000*500 on the above examples I get:
- the 1st example results in a 10000*500 black canvas with the original image  in the center scaled to 500*500. That's reasonable but not what I would like.
- the 2nd example results in a 10000*500 black canvas with the original image  in the center scaled to 500*50 !!. What may be the logic behind this?
- the 3rd example results in a 10000*500 black canvas with the original image  in the center scaled to 250*500. That's reasonable again.But still not what I would like.

Using 1dim-resize to 500 on the above examples I get:
- the 1st example results in a 500*500 scaled image. 
- the 2nd example results in a 500*50 scaled image. 
- the 3rd example results in a 250*500 scaled image.
This is also not what I need.

I would like something like this (aspect ratio = width/height)

if (destination aspect ratio >= source aspect ratio)
   scale factor = destination height / source height
else
   scale factor = destination width / source width
Comment 3 Johannes Wienke 2009-10-18 12:16:16 UTC
Ok, I will have a look at the 2dim resize tool an add an option to select whether you want the image to be filled to the specified size with a background or not.
Comment 4 Stefan Hühne 2009-10-18 13:12:59 UTC
Great! :-)
BTW what's the idea behind scaling the 10000*1000 image to 500*50 (2dim, 2nd example), thus fitting neither dimension? I would have expected 5000*500.
Comment 5 Johannes Wienke 2009-10-18 13:17:47 UTC
Probably a bug. ;)
Comment 6 Johannes Wienke 2009-10-19 01:45:18 UTC
SVN commit 1037411 by jwienke:

Complete refactoring of batch resize tool to a more object oriented interface. Also tried to do bug fixing for 2 dim proportional tool. The border option there is removed completely. The same behaviour can already be achieved with the batch border tool.

Print preparation has the same behaviour as before the refactoring but I'm not quiet sure that this is the desired behaviour. Will be checked soon.

CCBUG: 210874

 M  +1 -0      CMakeLists.txt  
 AM            resizecommandbuilder.cpp   [License: GPL (v2+)]
 AM            resizecommandbuilder.h   [License: GPL (v2+)]
 M  +75 -413   resizeimagesdialog.cpp  
 M  +26 -23    resizeimagesdialog.h  
 M  +586 -344  resizeoptionsdialog.cpp  
 M  +268 -52   resizeoptionsdialog.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1037411
Comment 7 Johannes Wienke 2009-10-19 01:46:50 UTC
Stefan, could you please check if all tools (except print stuff) now work as expected for you?
Comment 8 Johannes Wienke 2009-10-19 22:12:02 UTC
SVN commit 1037696 by jwienke:

Print prepare resize tool now works more like one could expect.

CCBUGS: 210874

 M  +35 -88    resizecommandbuilder.cpp  
 M  +6 -8      resizecommandbuilder.h  
 M  +15 -36    resizeoptionsdialog.cpp  
 M  +2 -7      resizeoptionsdialog.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1037696
Comment 9 Stefan Hühne 2009-10-20 10:20:47 UTC
I tested with rev. 1037824. All my wishes have come true :-) 1dim, 2dim and nonprop resize work as I had in mind. Thanks!
If you could just restore the previous order in the 'type' drop-down-list. I think, 2dim or 1dim should be the default...
Comment 10 Johannes Wienke 2009-10-21 21:50:00 UTC
SVN commit 1038761 by jwienke:

 * restored ordering of resize tools
 * some code cleanup

BUG: 210874

 M  +122 -75   resizeimagesdialog.cpp  
 M  +4 -29     resizeimagesdialog.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1038761