Page 1 of 2

trying to resize and copy to another folder

Posted: 2017-02-26T01:55:28-07:00
by xander_31404
hey guys!
I'm trying to get these images I have down to a width of 640. They also need to be copied to another folder I created.The originals need to remain unchanged. I'm new to this bat work. I'm kind of lost. This is what I got so far which aint much.

REM RAG
@echo off
C:/Users/mysta/OneDrive/Documents/batch_proj-files
mogrify -path /Users/mysta/OneDrive/Documents/newresizedpics resize 640%*.jpg

Re: trying to resize and copy to another folder

Posted: 2017-02-26T01:58:30-07:00
by fmw42
I am not sure what is wrong other than you need a space between 640% and *.jpg

If in a bat file, then % needs to be escaped to %%

Your -path folder needs to exist. IM will not create it.

That is the path to the output. You must cd to the input folder first. In Windows you need to provide window paths with \ not /. You are currently using Unix style paths.


Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620

For novices, see

viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/

Re: trying to resize and copy to another folder

Posted: 2017-02-26T08:56:12-07:00
by snibgo
xander_31404 wrote:resize 640%*.jpg
As Fred says, you need a space after %.

IM options start with a "-".

In BAT files, each % needs doubling.

So:

Code: Select all

-resize 640%% *.jpg
This will increase the sizes to 640%, ie they will become 6.4 times as wide and high. Is that what you want? If you want 640 pixels, leave off the percent. See http://www.imagemagick.org/script/comma ... p#geometry

Re: trying to resize and copy to another folder

Posted: 2017-02-26T15:55:16-07:00
by xander_31404
Hey guys

I'm sorry if I didn't disclose the correct information to you guys. I'm new to this and trying to figure everything out. I made the correction that yall talked about. When I opened command prompt in the folder of the pictures and ran the bat it said it mogrify' is not recognized as an internal or external command, operable program or batch file.

REM RG
@echo off
C:\Users\mysta\OneDrive\Documents\batch_proj-files
mogrify -path C:\Users\mysta\OneDrive\Documents\web-img -resize 640%% *.jpg

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:07:59-07:00
by snibgo
Have you installed ImageMagick? Where is it? Do you have mogrify.exe?

I suggest you don't do "echo off" until your script works. It just makes debugging harder.

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:20:24-07:00
by xander_31404
No I do not have imagemagick installed. I was not aware that I had to download a program. I'm in a class an I'm lost. Just not getting great instruction.
Is there a certain place it needs to be downloaded and running from. No I do not have mogrify.exe

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:30:58-07:00
by snibgo

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:37:47-07:00
by xander_31404
I downloaded the v7 version and It's still not accepting that bat

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:45:39-07:00
by snibgo
Same questions: "Have you installed ImageMagick? Where is it? Do you have mogrify.exe?"

Re: trying to resize and copy to another folder

Posted: 2017-02-26T16:52:50-07:00
by xander_31404
I have image magick display running from my program folder. Its also has a shortcut on the desktop. Is mogrify.exe come with image magick or do I have to download it from a separate place.

Re: trying to resize and copy to another folder

Posted: 2017-02-26T17:03:59-07:00
by snibgo
Did you follow the intructions on the link that I gave? Did you test that "magick logo: logo.gif" etc worked?

So, you don't have mogrify.exe. Do you have magick.exe? If you do, put "magick" at the front of the fourth line, so it reads:

Code: Select all

magick mogrify -path C:\Users\mysta\OneDrive\Documents\web-img -resize 640%% *.jpg
Incidentally, I don't know what your third line (C:\Users etc) is for or what you want it to do.

Re: trying to resize and copy to another folder

Posted: 2017-02-26T17:16:09-07:00
by xander_31404
Ok, this whats suppose to be happening. I have a folder called batch_proj-files that has 11 jpg in it. They need to be resized to the width of 640 then moved to the second folder called web-img. my batch file should take the file extension of the extension of the image type to be resized as an argument.

Re: trying to resize and copy to another folder

Posted: 2017-02-26T17:17:02-07:00
by xander_31404
I did follow the instruction the logo gif worked just fine

Re: trying to resize and copy to another folder

Posted: 2017-02-26T17:29:28-07:00
by snibgo
xander_31404 wrote:Ok, this whats suppose to be happening.
So, does it work? What error messages do you get? Did you intend to "cd" to that directory?

Re: trying to resize and copy to another folder

Posted: 2017-02-26T19:27:43-07:00
by xander_31404
no it does not work

this is the error I get "mogrify' is not recognized as an internal or external command,
operable program or batch file."

I opened command prompt in the folder that had the original photos in it