Page 1 of 1

ImageMagick convert problem

Posted: 2010-02-01T00:38:58-07:00
by iraniangirl
Hi

I want to convert a .png file to .jpg file using convert command of ImageMagick as follows:

convert file.png file.jpg

The convert command is executed with no errors, but there is no file.jpg produced.

Would you please help me in this regard?

Thanks in advance

Re: ImageMagick convert problem

Posted: 2010-02-01T01:03:13-07:00
by SilversleevesX
iraniangirl wrote:Hi

I want to convert a .png file to .jpg file using convert command of ImageMagick as follows:

convert file.png file.jpg

The convert command is executed with no errors, but there is no file.jpg produced.

Would you please help me in this regard?

Thanks in advance
Try naming the output file with a specific prefix, like
  • convert file1.png JPEG:file1.jpg
At the very least, should it work with the file format prefixed like this, you should have little trouble spotting the JPEG in all capital letters.

I caught on to this method while Google-ing how to extract iptc data from ImageMagick. The page that helped in this regard was
http://blog.robfelty.com/2009/03/15/rea ... agemagick/ .
And I just got the "correct and proper" file type abbreviation ImageMagick uses from here.

Have you been able to convert files to PNG or JPEG before in ImageMagick on the command-line? You may be missing a library file/bundle or two.

Hope this helps.

BZT

Re: ImageMagick convert problem

Posted: 2010-02-01T09:25:47-07:00
by fmw42
iraniangirl wrote:Hi

I want to convert a .png file to .jpg file using convert command of ImageMagick as follows:

convert file.png file.jpg

The convert command is executed with no errors, but there is no file.jpg produced.

Would you please help me in this regard?

Thanks in advance
what version of IM are you using? did you install from source or binary? if from source, you may need the delegate libraries installed first for png and jpg and then reinstall IM. (see http://www.imagemagick.org/download/delegates/) To check what you have type

convert -list configure

and look at the line starting with DELEGATES. see if it has png and jpg

Re: ImageMagick convert problem

Posted: 2010-02-01T10:25:33-07:00
by el_supremo
You could also do a simple test. Try these two commands:

Code: Select all

convert logo: logo.jpg
convert logo: logo.png
Do these two commands produce logo.png and logo.jpg?

Pete