trying to resize and copy to another folder

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?".
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

trying to resize and copy to another folder

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: trying to resize and copy to another folder

Post 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/
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post 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
snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post 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.
snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post by snibgo »

snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post by xander_31404 »

I downloaded the v7 version and It's still not accepting that bat
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post by snibgo »

Same questions: "Have you installed ImageMagick? Where is it? Do you have mogrify.exe?"
snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post 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.
snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post 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.
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post by xander_31404 »

I did follow the instruction the logo gif worked just fine
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trying to resize and copy to another folder

Post 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?
snibgo's IM pages: im.snibgo.com
xander_31404
Posts: 8
Joined: 2017-02-26T01:44:02-07:00
Authentication code: 1151

Re: trying to resize and copy to another folder

Post 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
Post Reply