DigiKam: how to resize images to fit right - [with online-demo]

hello dear friends, good day,.

i run Digikam on a OpenSuse 12.1 -

i have a bunch of photos that i want to show in a image slider on the Web.

They images have the following data

**size: **3,2 MiB
size in pixel: 4 603 x 3 072 (14.16Mpx)

to get a size that can be processed and shown in a image-slider i need to have the images in another size.

eg like the following: just see this example site for getting an feeling of the size
i examined the size and saw that they use a individual height in the slider and
a width of 760 pixel

All looks nice and tidy.

my question is: how can i get pictures that have this size? Note: i have alot of images - so i look for a smart way to do the processing - in order to treat many images at once.

if i have to explain more - do not hesitate to ask.

love to hear from you -

What about ‘KIM’
from packman, a kde service menu

Hello my dear caf4926, good day, great to hear from you!!

many thanks for the answer - i will try it out - and have a closer look at your solution. it sounds interesting. well since i use the imageprorgramme digikam in OpenSuse 12.1 i can do it with a little script:

besides the scripting way there is another way: in digikam we can do it with such a way-

first solution: export to html, then we get the right images (and other file we may discrad)

or even better, if we use a tiny little script like the following one:

for I in *.jpg ; do
       convert -resize 800x600 $I $I ;
       echo -n "." ;

done - what do you say!?

well - i will create the resized ones - Note i have to take care that i do not change the relation between height and width. But that will be not the big problem - i think that i do some calculation with the following data.

  • at the moment all ** images horizontally** are in the same size: 4 603 x 3 072

  • at the moment all images vertically are in the same size: 3 072 x 4 603

i will do a calculation of the height to width-ratio and then i get the new height and new width. With the new data i run the script and then i get all the images resized.

i will try it out

hello back again

some additional information

see the libraries that are installed on the machine

martin@linux-wyee:~> rpm -qf $(which convert)

a guy on a mailing list told me the two ways which were possible - see them here: i want to share them with you…:

Way #1:

for I in *.jpg ; do
 convert -resize 800x600 $I ${I%.jpg}_resized.jpg ;
 echo -n "." ;

Way #2

for I in *.jpg ; do convert ${I} ${I%.jpg}_resized.jpg ; done

one can do this on a single line which is very coool

Note the change. The second $I becomes ${I%.jpg}_resized.jpg – the %.jpg is the part that tells bash that the part of the filename that follows the % should be removed and then what follows the } will be added. Thus the .jpg in the first filename becomes _resized.jpg in the second one:


note - got the hints on the mailing-list for DigiKam [org]

thx to the friendly support over there…