Hyperionics Support
Hyperionics Support
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hyperionics Support (moderated)
 HyperSnap Support
 batch commands to do multiple things...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rondunnjr

7 Posts

Posted - 10/17/2009 :  02:07:52  Show Profile  Reply with Quote
I've got a folder full of .jpg images.

They all need to be "auto trimmed" to remove any dead space on the sides of the object in the image.

Then then need to scaled to 500 wide and saved, then scaled again to 150 wide and saved with the original file name PLUS -tn.jpg

so an image in the folder called 1234.jpg will be auto trimmed, scaled to 500 wide (or less if it's already under 500), then saved as 1234.jpg, then scaled to 150 wide and saved as 1234-tn.jpg

Am I dreaming or can this be done?

I don't mind having to run 3 different command lines if needed.

Admin

USA
4945 Posts

Posted - 10/19/2009 :  10:34:41  Show Profile  Reply with Quote
I added a lot of command line parameters to HyperSnap over the years, many of them are not documented at all. I'll have to sit down one day and document them all. For the above operations, I'd have to add some code, because there is image scaling command line option to a specified width for example, but there is to "auto-trim" command line. If you want, contact me by email, providing your full name, address and license serial number, and I can custom-add the auto-trip option for you, so that you could do this.

Greg
Go to Top of Page

rondunnjr

7 Posts

Posted - 10/20/2009 :  19:12:08  Show Profile  Reply with Quote
Thank you! Email sent with the details.
Go to Top of Page

Admin

USA
4945 Posts

Posted - 10/26/2009 :  09:58:17  Show Profile  Reply with Quote
Yes, got it, thank you. Had not time to work on this yet, but will try my best this week.

Greg
Go to Top of Page

Admin

USA
4945 Posts

Posted - 10/31/2009 :  10:58:55  Show Profile  Reply with Quote
Hi,
You could now re-download and install on top of what you have ver. 6.62.02 of HyperSnap. I updated it today without changing the version number. It contains a new command line parameter, -at, to perform an auto-trim. For example, to load a test.jpg file, auto-trim it, scale to width 500 pixels and save in a sub-directory "trimmed" you could run HyperSnap 6 as follows:

"C:\Program Files\HyperSnap 6\hprsnap6" test1.jpg -at -scale:w500 -save trimmed\test1.jpg

This assumes that your HyperSnap 6 is installed in "C:\Program Files\HyperSnap6" directory, and that you are running the program in the current directory, where test1.jpg file is present. Also the sub-directory "trimmed" must be already created.

To convert a full folder of JPG files like that, you could use the "for" command of the Windows batch language:

for %f in (*.jpg) do start/wait "HS" "C:\Program Files\HyperSnap 6\hprsnap6" %f -at -scale:w500 -save trimmed\%f

If you want to create a batch file, e.g. trimscale.bat, you would need to replace %f with %%f in the above command. You could then run a similar command inside "trimmed" folder to perform only scaling to 150 pixels for the thumbnails, but remember to save them again to a different subdirectory so that the original or trimmed pictures would not be overwritten.

Greg
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hyperionics Support © 1995-2010 Hyperionics Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07