Page 1 of 1

Struggling with bat in Win7

Posted: 2012-10-07T06:49:37-07:00
by Parduz
Hello from Italy (pls excuse my poor english).

I'm trying to do some tile cropping, but i'm becoming crazy with the bat file.

This is how it is after reading the help and the "using magick in windows":
SETLOCAL EnableDelayedExpansion
convert "%1" -crop 660x500 +repage +adjoin "card_%~n1_%%02d.png"
pause
This is what i get back:
D:\ImmaginiCarte>convert "D:\ImmaginiCarte\01.png" -crop 660x500 +repage +adjoin
"card_01_%02d.png"
Parametro non valido - -crop
(which means "invalid parameter - crop")

I'm sure i've missed something, but i can't figure what. Any help?

Also:
why i can't use pathnames/filename like "D:\== TEMP FOLDER==\ - this is a strange name -\filename"?
It keeps keeping the "minus signs" or the "equals" as parameters...


Oh, using Win7 32 ultimate (italian)
Thanks

Re: Struggling with bat in Win7

Posted: 2012-10-07T07:50:20-07:00
by Bonzo
Windows has a convert program to rename files and sometimes this is what you are running and not the Imagemagick convert program

Have you had Imagemagick running at all in your setup?

Re: Struggling with bat in Win7

Posted: 2012-10-07T09:07:09-07:00
by Parduz
Well, what it runs if i just type "convert" in a cmd window is IM.
So i'm guessing it is IM also for my bat file.

Re: Struggling with bat in Win7

Posted: 2012-10-07T09:50:15-07:00
by Bonzo
Best to check the obvious!

What happens if you remove the SETLOCAL EnableDelayedExpansion

Re: Struggling with bat in Win7

Posted: 2012-10-07T10:31:50-07:00
by whugemann
There is nothing wrong with that batch file. It runs fine on my Windows computer. There is also nothing wrong with setting SETLOCAL at the start of it. So I guess it is some mix-up with the Windows convert command. Rename the IM Convert into something else (e.g. IMconv.exe) and call that program in your batch file instead.

Have you tried to do some other simple convert operation in a CMD box?

Re: Struggling with bat in Win7

Posted: 2012-10-07T14:24:54-07:00
by indiego
I have taken this from the draft documentation of my upcoming ConTeXt module.
Hope this helps...

Pitfalls: the 'convert.exe' problem

There is an equal named program on Windows OS, that converts the file system
of a given drive from fat32 to ntfs. If this program is called instead of the IM binary,
you have to edit the $PATH variable.
The entry for IM must stand before the "c:\windows*" entries.

I highly recommend Redmond Path for this job. Editing this long
environment variable by hand is both unclear and cumbersome.

Beware: older Windows versions than Vista need a complete restart of the OS
to make the change happen!

http://www.softpedia.com/get/System/Sys ... Path.shtml

Re: Struggling with bat in Win7

Posted: 2012-10-10T17:43:23-07:00
by anthony
This is one reason why the new command in IMv7 is called "magick".