Page 1 of 1

Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T10:58:43-07:00
by user989797

Code: Select all

convert 1.jpg -gravity South  -chop  0x25  2.jpg
Above works when I run the bat file by double clicking manually or when I type in command prompt but it gives an error when I try and run via an automation tooI use. You won't have heard of the tool so I won't mention it :). but it just runs command prompt operations via a process. I will ask over there too if there are no possible answers here but wanted to ask here for common issues cos I doubt they will have the answer there since I had another issue with ffmeg in the past and didnt get the answer there.

Same thing happened when I used ffmpeg once but when I typed in the full path to ffmpeg ie F:\ffmpeg\ffmpeg.exe etc etc then it worked.

So I thought to try that in this case using F:\magic\convert.exe but it still didn't work.

I have the image I want to edit in a seperate folder just called F:\imrun

Any ideas?

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T11:06:43-07:00
by snibgo
user989797 wrote:... but it gives an error ...
What error does it give?

Are you running this tool in the directory containing 1.jpg? What happens when you "dir 1.jpg" from the tool?

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T11:13:05-07:00
by user989797
What do you mean by "dir 1.jpg"? The tool doesnt have a command line it is drag and drop operations.

Looking at the error in the command box before it closes I see the error is error loading (imagemagick) module, and file path but I cant get the command box to stay open to tell you the full module that cant load. I will try and get it if it will help?

Yes Im running directly in the dirrectory. The bat file is in the same folder as file 1.jpg.

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T11:16:13-07:00
by user989797
convert.exe: "no decode delegate for this format JPEG"
convert.exe: no images defined

So it seems imgemagick cannot communicate somehow?

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T12:07:44-07:00
by Bonzo
If it works as in a bat file I would say you do not have an Imagemagick problem and saying "You won't have heard of the tool so I won't mention it" is not that helpful as the problem could be anything. If you told us the name we could look the tool up and see how it works.

What happens if you drop the file over the bat file icon; what exactly do you have in the bat file?

If dragging and dropping, your input filename should be a variable not hard coded. This is one of my batch files:

Code: Select all

convert.exe %1 -thumbnail 200x200 -quality 100 "%~n1.png"

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T12:26:52-07:00
by user989797
Well I ended up doing a mogrify on the batch via command so didnt need to use the other program. :)

The program is:
http://zennolab.com/en/products/zennoposter/

I may want to do it in future (ie run imagemagick on the fly via the other program) but for now I just needed to chop a batch of pics.

Thanks for the help though. Problem averted for now :)

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T12:46:37-07:00
by Bonzo
You were right, that program link will be no help in sorting the problem out!

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T13:38:12-07:00
by user989797
Ye I wasnt just being awkward :D.

Re: Why doesn't it work from .bat file via 3rd party program?

Posted: 2015-08-13T15:11:21-07:00
by fmw42
I would guess that it is your other program that is at issue and perhaps cannot find the JPG delegate it needs.