Page 1 of 1

resize (bat) script crash

Posted: 2020-03-22T08:30:17-07:00
by omerdor
Hi

This is my first post here, so hope my questions is ok.

i found a script that resize pictures Online, I turned it into BAT and tried to run it.

But when I try to run it Immediately collapsed , From what I've been able to see he writes an error that something doesn't exist.

this is the script :

Code: Select all

mogrify -strip -format jpg  *.png
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 50x50 -write Done\\%%[filename:name]_Sma.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 150x150 -write Done\\%%[filename:name]_Med.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 280x280 -write Done\\%%[filename:name]_Big.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 500x500 -write Done\\%%[filename:name]_Enlarge.jpg *.jpg
it didnt see that i do something worng , but its the first time i using IMAGEMAGICK so it is possible that I did not install something good or did somethign else worng .

Thanks .

Re: resize (bat) script crash

Posted: 2020-03-22T10:12:53-07:00
by snibgo
What version of IM?

I suppose you are using Windows, with a BAT script.

Don't use double backslash "\\" in the filename.
omerdor wrote:From what I've been able to see he writes an error that something doesn't exist.
What is the exact error message?

Re: resize (bat) script crash

Posted: 2020-03-22T11:02:28-07:00
by omerdor
hi

i using windows , and the version that i Download is : ImageMagick-7.0.10-2-Q16-x64-dll.exe

And the Error is something like : "file name " is not recognized as an internal or external command , operable program or batch file

but its crash Really fast so i not sure that all

Thanks.

Re: resize (bat) script crash

Posted: 2020-03-22T11:39:12-07:00
by snibgo
How are you running the script?

I suggest you run the script (and any other scripts) by: (1) open a command window, aka command prompt aka console, then (b) type the name of the script and press the return key.

Then you will see any error messages. You can copy-and-paste them here.

Re: resize (bat) script crash

Posted: 2020-03-22T23:50:53-07:00
by omerdor
hi

i run it with the cmd and the error was :

'resize' is not recognized as an internal or external command , operable program or batch file .

what can i do to fix it ?

Thanks .

Re: resize (bat) script crash

Posted: 2020-03-23T01:39:49-07:00
by snibgo
The BAT script that you showed cannot fail with that error.

As you are running IM v7, I suggest you use "magick mogrify" instead of just "mogrify". But that won't cure the error you show.

Re: resize (bat) script crash

Posted: 2020-03-23T08:09:14-07:00
by omerdor
hi

i try to change it to "magick mogrify" but it didnt worked .

so what can make this error ?

Do I need to put the photo opening on default of imageMagick ?

Because when i click right click and open with on a picture i cant see open with imagemagick .

Thanks

Re: resize (bat) script crash

Posted: 2020-03-23T15:04:19-07:00
by snibgo
The BAT script that you showed cannot fail with that error.

Please show your complete script.

Your script contains five commands. Which one has that error? What happens with the other commands?

Re: resize (bat) script crash

Posted: 2020-03-24T10:12:12-07:00
by omerdor
hi

this is the full script :

mogrify -strip -format jpg *.png
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 50x50 -write Done\\%%[filename:name]_Sma.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 150x150 -write Done\\%%[filename:name]_Med.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 280x280 -write Done\\%%[filename:name]_Big.jpg *.jpg
mogrify -resize 2000x2000 -extent 2000x2000 -gravity Center -fill white -set filename:name %%t -resize 500x500 -write Done\\%%[filename:name]_Enlarge.jpg *.jpg

as he write in the txt.file i try to run it on the desktop as a batch .

i dont know maybe i need to change the path of the file or something like this , or should i make its batch in other way ?

Re: resize (bat) script crash

Posted: 2020-03-29T02:14:21-07:00
by omerdor
hi

i try to fixed the problem and now its giveing me this window when i run the script what can i do to fix it :

Image

Thanks for help

Re: resize (bat) script crash

Posted: 2020-03-29T02:42:45-07:00
by snibgo
It is telling you that "mogrify" isn't installed on your system. As I said upthread, you have v7, so your command should start "magick mogrify".

Re: resize (bat) script crash

Posted: 2020-03-29T03:31:59-07:00
by omerdor
hi

i change the start of the command to magick mogrify and now the error says :

Image

Re: resize (bat) script crash

Posted: 2020-03-29T05:17:48-07:00
by snibgo
You have five commands in that script. All of them tried to call "mogrify" but you don't have that program. You should change all of them to start "magick mogrify".

Ensure you have a space after "magick mogrify" so the first command has a space between "mogrify" and "-strip".