ImageMagick convert problem

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
iraniangirl

ImageMagick convert problem

Post 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
SilversleevesX
Posts: 2
Joined: 2010-01-31T23:56:43-07:00
Authentication code: 8675309

Re: ImageMagick convert problem

Post 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

Code: Select all

 >> convert -version
Version: ImageMagick 6.4.0 04/17/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick convert problem

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: ImageMagick convert problem

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Post Reply