Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to convert a JPEG to a PNG using ImageMagick. Should be easy, right? What am I doing wrong?

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % convert -version                                                                      [12:12:37]
Version: ImageMagick 6.8.7-7 Q16 x86_64 2013-11-27 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg ltdl png xml zlib

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % ls -lh                                                                                [12:12:42]
total 2104
-rw-r--r--@ 1 ilesm  staff   1.0M  5 Apr 12:12 image.jpg

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % file image.jpg                                                                        [12:12:48]
image.jpg: JPEG image data, JFIF standard 1.01

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % identify image.jpg
image.jpg JPEG 2448x3264 2448x3264+0+0 8-bit Gray 256c 1.075MB 0.000u 0:00.000

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % convert image.jpg image.png

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % ls -lh
total 4208
-rw-r--r--@ 1 ilesm  staff   1.0M  5 Apr 12:12 image.jpg
-rw-r--r--  1 ilesm  staff   1.0M  5 Apr 12:13 image.png

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % file image.png
image.png: JPEG image data, JFIF standard 1.01

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ % identify image.png
image.png JPEG 2448x3264 2448x3264+0+0 8-bit Gray 256c 1.075MB 0.000u 0:00.000

╭ ~/tmp2 ilesm@mb-ilesm.local
╰ %

Note that file and identify both tell me that my resulting 'image.png' file is actually a JPEG. What's going on?

UPDATE

Hmm, on further investigation I found that ImageMagick's PNG support was busted. I couldn't read other PNG images, etc. I'm using Homebrew so I did brew unlink imagemagick, brew uninstall imagemagick, brew install imagemagick and it and now it seems to be working.

share|improve this question
    
Your steps seems correct, it should be as simple as that. Try to pin down if it is the source file or the ImageMagick installation by trying other source files (something random off the internet). –  peanut_butter Apr 5 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.