They say you learn something new every day.

For some websites that I run I fairly regularly need to resize some photos to a certain width. ImageMagick is a great application for command line image manipulation.

The syntax to convert a file to a specific width and the corresponding height (which is what I want to do) is:

convert InputName.jpg -resize 550x Outputname.jpg 

What I’ve found useful is running command line scripts through vbscript:

Set wshShell = WScript.CreateObject(“WSCript.shell”)
wshShell.Run “cmd.exe /C convert InputName.jpg -resize 550x Outputname.jpg”, 0, True

I know you can do all sorts of clever things from the command line, but not quite as many as vbscript can. I find it really useful to be able to access all of the vbscript logic, and read and write text files and so on, while at the same time being able to issue commands to the command prompt.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: