Command line Resize Query - RealWorld forums

Log-in or register.

Command line Resize Query

Is this possble?
albionuk
on July 11th 2011

I've tried to create a bat file that will run a process with the following requirements but I've hit a brick wall. It would need to look into sub folders and amend images with the following switches.

  • Source and destination folder are the same so the original image is replaced (not creating an additional image)
  • The long edge is sized down to 1280
  • The aspect ratio is maintained
  • If the original image long edge is smaller than 1280 it is is not changed
  • the date and time are maintained from the original.
  • The quality is not reduced

I hope this makes sense and if you can help I'd be very grateful.

Many thanks
Glyn

Vlasta
on July 11th 2011

PhotoResize1280ISEH.exe

(quality is always affected when the number of pixels is changing...)

albionuk
on July 11th 2011

Thanks for that!

I appreciate the quality is reduced when resolution changes but I did not want it reduced any further (I should have said).

How would I deal with the source and destination being the same and will the command you suggested look into child folders?

Many thanks
Glyn

Vlasta
on July 11th 2011

That command will overwrite the original files as you requested (the I in the filename stands for in-place resizing).

To also process sub-folder, add R to the filename:

PhotoResize1280ISEHR.exe

albionuk
on July 11th 2011

Thanks for the prompt reply, I've tried PhotoResize1280ISEHR.exe from the root of the folders I wish to process but I get the box with details on how to use the application.

I'm running from command prompt with a bat file, remembering to change the file name in the bat file as the executable is updated.

Thanks again.

Glyn

Vlasta
on July 11th 2011

If you see the window with instructions, the path to the folder to process is missing or incorrect - use full path to the on the safe side.

I would recommend you to test the tool outside of the .bat file and when all works correctly, then integrate it into the bat file.

Anonymous
on July 11th 2011

I'm at a bit of a loss...

If the colection was in "c:\pictures" which contained lots of folders 1, 2, 3, 4 etc... then how would I structure the bat command?

Sorry to be so basic...

Cheers,
Glyn

Vlasta
on July 12th 2011

PhotoResize1280ISEHR.exe "c:\pictures"

...should be enough

albionuk
on July 12th 2011

Cracking, it works like a dream

Thanks very much.

Page views: 9771       Posts: 9      
Select background
Vista & Win 7 icons
I wish there were...