Posts: 1,000
Threads: 253
Joined: Feb 2008
I have a stupid work task that people keeping dumping on me while I am trying to do much more important jobs...
So of course I am going to automate the process or make it easier for them to do it so they stop asking me to do things they should be doing themselves.
I need to resize all pictures in a folder to a specific size. So before I go reinventing the wheel trying to figure this out for myself, I figured I'd post to see if anyone has done this already or knows a good dll that would get me in the right direction.
Thanks,
jimmy Vig
Posts: 12,095
Threads: 142
Joined: Dec 2002
Do you know a free image viewer/editor/converter IrfanView? It can resize images, and the quality is good. It also has options like "batch convert". I don't remember how exactly it works, but probably it can resize multiple images, for example all in a folder.
QM could resize only bmp files. Or could use some component, but I would instead use something that is well tested and has good quality, like IrfanView.
Also look in IrfanView help, command line...
Posts: 12,095
Threads: 142
Joined: Dec 2002
Macro
Macro1278
str f1 f2
f1.expandpath("$my pictures$\screensaver2\*.jpg")
f2.expandpath("$my pictures$\screensaver2\converted\*.jpg")
str cl.format("''%s'' /resize=(500,300) /convert=''%s''" f1 f2)
;out cl
run "$program files$\IrfanView\i_view32.exe" cl
Posts: 1,000
Threads: 253
Joined: Feb 2008
Works like a charm. This is exactly what I needed.
str cl.format("''%s'' /resize=(0,300) /aspectratio /resample /convert=''%s''" f1 f2)
This sets the height and proportionately resizes the width.
Download the plugins and then:
str cl.format("''%s'' /jpg_rotate=(3) /resize=(0,300) /aspectratio /resample /convert=''%s''" f1 f2)
Rotates 90° and resizes.
This is truly great. Now to look at those print functions. That could be a lot of fun!
Thanks Gintaras!
jimmy vig
Posts: 1,000
Threads: 253
Joined: Feb 2008
if(!dir("c:\Pictures" 1))
mkdir "c:\Pictures"
str cl.timeformat("/capture=2 /convert=c:\Pictures\{yyyy}.{MM}.{dd}({HH}{mm}.{ss}).jpg")
run "$program files$\IrfanView\i_view32.exe" cl
Neat.