user iconalbionuk on July 11th 2011
9813 views

topic iconCommand line Resize Query

Is this possble?

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

user iconVlasta on July 11th 2011 0

PhotoResize1280ISEH.exe

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

user iconalbionuk on July 11th 2011 0

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

user iconVlasta on July 11th 2011 0

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

user iconalbionuk on July 11th 2011 0

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

user iconVlasta on July 11th 2011 0

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.

user iconAnonymous on July 11th 2011 0

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

user iconVlasta on July 11th 2011 0

PhotoResize1280ISEHR.exe "c:\pictures"

...should be enough

user iconalbionuk on July 12th 2011 0

Cracking, it works like a dream

Thanks very much.

user icon