need help on image resize (don't crop, resize and keep ratio)

Recommended Posts

Hi

I have a problem and i don't know how to solve it

I have lots of images (approx. 2000) which should be resized as follows (the aspect ratio should be kept at all times!):

-get the pixelsize of the longest side (width or height)

1. if the width is above 1000, resize it to 1000 (the height will be scaled accordingly without affecting the ratio)

or

2. if the height is above 1000, resize it to 1000 (the width will be scaled accordingly without affecting the ratio)

Currently i use a call to IrfanView for this, but its quite slow.

`"i_view32.exe O:\pics\0001.jpg /resize=(1050,0) /aspectratio /resample /convert=O:\pics\0001.jpg`

Is there a way to handle this using GDIPlus?

Cheers,

Thomy

Share on other sites

Br,

UEZ

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share on other sites

Have a look at this: >link

Snips & Scripts

My Snips: graphCPUTemp ~ getENVvars
My Scripts: message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

Create an account

Register a new account