simple task for newbie - need some help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
quintosol
Posts: 2
Joined: 2012-10-09T08:31:32-07:00
Authentication code: 67789

simple task for newbie - need some help

Post by quintosol »

I need to make a simple bat file to automatically apply to all JPG images when they're placed into a folder. This will run on a Windows 2003 Std Server (for now). I'll I need to do is resize the images to 245x306 pixels, move them to a new folder, and delete the original files. Not sure if I need to run CONVERT or MOGRIFY command. Anyone available to help out? I'd like to have it run automatically in the background on the server, but if it takes another app to apply the batch file - I'm fine w/that.

Originating folder location:
D:\5SunJPEGs\5Sun Sales\AX_Image_Input
D:\5SunJPEGs\5Sun Sales\AX_Record_Images

Final file resolution in pixels 245x306

I might want to change the format to PNG, as it may help w/compression artifacts, but may not be needed since the image will be for a database reference image only.

Thanks in advance!

I'll even throw in a couple of free t-shirts if someone can help me out (any Star Wars or Angry Birds fans out there?).
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: simple task for newbie - need some help

Post by Bonzo »

I need to make a simple bat file to automatically apply to all JPG images when they're placed into a folder.
I think this is the hard part as you need a program/batch file to watch the folder for changes.

Why cant you add the resize code to the image upload code.
quintosol
Posts: 2
Joined: 2012-10-09T08:31:32-07:00
Authentication code: 67789

Re: simple task for newbie - need some help

Post by quintosol »

The images will be dropped into a folder that has to run unattended and resize and move to another folder. Not complicated - I just can't seem to get the bat file to function anymore. The image file names have spaces in them, and it keeps seeing each word in the file name as a separate file. I can do what I need to do w/photoshop action/droplet, but I prefer to have IM do this simple task.

Not sure what you mean by adding resize code to upload code.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: simple task for newbie - need some help

Post by Bonzo »

As you are using "drag and drop" you do not have any upload code so that option is out.

The method in windows of dealing with filenames with spaces is to enclose the filename/path in " " but that never seemed to work very well for me. I still had errors and I do not know if it was a Windows or IM problem. If it is a IM on Windows problem you could replace the space with a _ before passing the filename to the IM comand.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: simple task for newbie - need some help

Post by anthony »

If you can get a list of 'new files' then you can just give that list as arguments to a montage to generate your 'thumbnails', in another directory.

See... General Thumbnail Creation, and the montage example. Adjust to suit.
http://www.imagemagick.org/Usage/thumbnails/#creation

You maay want to replace (or add to) the -format option with a -path option.
See Morgify Command Example...
http://www.imagemagick.org/Usage/basics/#mogrify
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply