Can't get IM to work (Solved, thanks Bonzo!)

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?".
Post Reply
Frank P

Can't get IM to work (Solved, thanks Bonzo!)

Post by Frank P »

Hi,

I want to use IM to convert jpeg and png to eps for LaTeX-documents. However I'm having lots of troubles, which are very demotivating and disapointing for a beginner though.

Version installed: ImageMagick-6.5.3-Q16
OS: Windows Vista Home Premium

When I use $magick> filename.jpg filename.eps, I get the error: $imagemagick is not recognized as an internal or external command, software, or batch file. (Maybe not literaly this, i'm translating it from Dutch)

When I use convert filename.jpeg filename.eps, I get the error: parameter not valid - filename.eps.

What's going wrong? Please not too many technical terms, I'm a beginner.
Last edited by Frank P on 2009-06-21T04:29:14-07:00, edited 1 time in total.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't get IM to work

Post by Bonzo »

I would guess you need ghostscript installed: http://www.ghostscript.com/

If you run this it shows the supported file types:

Code: Select all

convert identify -list format
What does it say next to EPS mine says rw- which means my setup can read and write eps files.
Frank P

Re: Can't get IM to work

Post by Frank P »

Hi,

I've installed GS en when I run

Code: Select all

convert identify -list format
I get the error

Code: Select all

Parameter not valid - list
Lots of beginners would have turned IM and GS off after all these errors, and would go back to GUI-software...
Jenkins

Re: Can't get IM to work

Post by Jenkins »

I just use windows batch files...

Like this;

Code: Select all

SET IMDIR=C:\Program Files\ImageMagick-6.5.1-Q16

SET APP=convert.exe
SET OPTS=-optionsgohere

"%IMDIR%\%APP%" %OPTS%
No need for GS imo unless you specifically want to use the $imagemagick (Linux type) Syntax

Remember to include the ".exe" for the different programs like Mogrify.exe, Convert.exe etc

Oh and because your on Vista you need Admin rights to run the batch from memory

I think this is what you were after, hope it helps all the same :)

-Jenkins
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't get IM to work

Post by Bonzo »

I do not know what the $magick> means as I use the command line. I assumed you were using the Command prompt in windows ?

I would start with something simple to prove IM is working first.
In the command line paste this and it should confirm the IM version:

Code: Select all

convert -version
Did you paste my previous code into the command line ?

When working with windows you still need to get the paths correct; I have a example of how I did it on my site: http://www.rubblewebs.co.uk/imagemagick ... indows.php

As Jenkins says you can run from batch files. This is a file I have on my desktop saved as resize.bat and all I need to do is drag and drop a file into it. Try it with a jpg and see if you get a thumbnail.

Code: Select all

:: Drag and drop resizing - saves the modified image back in the original directory

:: Adds the th_ to the front of the image name
convert.exe %1 -resize 640x640 -unsharp 1.5x1+0.7+0.02 -quality 80 "th_%~n1.jpg"
Frank P

Re: Can't get IM to work

Post by Frank P »

Hello,

Thanks for the reply's! But once again, the errors keep coming. When I run

Code: Select all

convert -version
I get the error: Drive specification not valid. This can be something alike, again I'm translating it from dutch.

Bonzo, I tried what you said with that .bat file. When I drag an image to it, a command window flashes up and dissapears again very quickly, and there nothing else that happens. Where should the tumbnail be located? Not on my desktop in any case...
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't get IM to work

Post by Bonzo »

I belive Windows does have a convert program built in for renaming files ?

A recomendation is to rename the IM convert program to something like IMconvert and use that instead of convert. I am using Vista home premium without any problems and it was an install without modifying anything.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't get IM to work

Post by Bonzo »

Didn't see this part of your post
Bonzo, I tried what you said with that .bat file. When I drag an image to it, a command window flashes up and dissapears again very quickly, and there nothing else that happens. Where should the tumbnail be located? Not on my desktop in any case...
The thumbnail should be in the same directory as the original image.

The command window flashes but its a second or so later before the image is displayed in the folder.
Frank P

Re: Can't get IM to work

Post by Frank P »

Bonzo wrote:I belive Windows does have a convert program built in for renaming files ?

A recomendation is to rename the IM convert program to something like IMconvert and use that instead of convert. I am using Vista home premium without any problems and it was an install without modifying anything.
Thank you Bonzo, now I have the right response on IMconvert -version! Convert is indeed a command that already existed in Windows. It's used to convert FAT volumes to NTFS. Now it all makes sense. And the conversion to eps files works!

And I managed to edit the bat-file to convert images to eps just by dragging them to the bat-file. I'm a photographer too and I think IM will be great for fast resizing and converting pictures, many at the same time

Many thanks for helping me, I was getting desperate.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't get IM to work (Solved, thanks Bonzo!)

Post by Bonzo »

Its strange how you had to rename convert but I have the same version of Windows and it works OK for me !

I am glad you are sorted and there is so much you can do with IM; I tend to use php as I do not know a lot about batch files. I have a server running on my PC and tend to do my conversions there.

Anthony has lots of examples on his site http://www.imagemagick.org/Usage/ and there is a new Windows section.
Post Reply