Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We recently installed the latest version of ImageMagick onto our Linux server. I seem to be having issues performing the most basic of tasks.

I am running this command line:

/usr/bin/convert /location/to/source/design.ai /location/to/save/output.jpg

Unfortunatly is saves design.jpg as an illustrator file (if I rename the file to output.ai it opens). Even if I do this:

/usr/bin/convert /location/to/source/design.ai -rotate 90 /location/to/save/design.jpg

It rotates the file and saves again as an illustrator document. This happens with all filetypes (e.g. png, bmp, etc...)

It appears ImageMagick cannot figure out what I want it converted to and just saves as the same file type.

Any ideas on fixing this?

Regards:

John

share|improve this question

4 Answers 4

Are you sure ImageMagick supports Illustrator files? That's a proprietary format that isn't supported by any programs outside of the the Adobe family AFAIK. I would be very surprised if ImageMagick supported it. It's also not listed on the ImageMagic supported formats page.

Try saving as a PDF, SVG, or any of the supported formats before you pass it to ImageMagick.

Edit:

There appears to be a way to read/manipulate AI files using ImageMagick, but this comes with the proviso that the AI file must be saved with PDF compatibility. If not, it will not work, as ImageMagick by default is configured to read AI files using its PDF coder. Though that isn't to say that someone can't write a custom AI coder for it. However, I've yet to see one and it would be difficult given that AI itself is a closed format (even the latest version of QuarkXpress has imperfect AI support).

share|improve this answer
    
That's probably the problem. Apparently Adobe Illustrator files look like PDF files , but are not. That's why ImageMagick does not complain when reading them, but fails to convert them properly. –  sleske Jun 20 '10 at 23:15
    
That makes sense. Illustrator files do have a PDF compatibility mode, but it's not a standardized format and changes from version to version. It also supports a super-set of features that are not present in the PDF specification. –  Lèse majesté Jun 21 '10 at 0:47
    
ImageMagick does support AI files. –  Unkwntech Aug 13 '10 at 22:49
    
@Unkwntech: upon more research, it does seem that people are successfully using ImageMagick to manipulate illustrator files, despite the fact that it's not listed in the supported formats page. At first I thought maybe someone wrote a custom coder for it, but looking at the sample coder.xml, it looks like they're just using the PDF coder (see sleske's comments). However, this only works with AI files that are saved with PDF compatibility. So either the OP did not save his AI file with PDF compatibility, or he is missing the AI entry in his coder.xml. –  Lèse majesté Aug 24 '10 at 5:43

Make sure you have the latest version of Ghost Script and double-check the method you're using to save the Illustrator Documents. They should be PDF-compatible. You might also want to try saving them to PDFs and EPS files directly, running the conversion process on those documents and seeing what happens.

share|improve this answer
    
Thanks Pender: It is the same with trying to convert png to jpg files. Would this fact eliminate your GhostScript suggestion? –  johnui Nov 23 '09 at 22:44
    
Yes, since GhostScript is related to the PDF portion. –  rooney Nov 24 '09 at 0:57

Try this:

/usr/bin/convert /location/to/source/design.ai JPEG:/location/to/save/output.jpg

As per http://www.imagemagick.org/Usage/files.

share|improve this answer
    
I just tried that and it does not output anything at all when added. –  johnui Nov 23 '09 at 22:44

Try with the density option:

/usr/bin/convert -density 150 /location/to/source/design.ai /location/to/save/output.jpg

You can play with the density (72, 300...) and see if it gives you any result.

Also you can try:

/usr/bin/convert /location/to/source/design.ai[0] /location/to/save/output.jpg
/usr/bin/convert -density 150 /location/to/source/design.ai[0] /location/to/save/output.jpg
share|improve this answer

Your Answer

 
discard

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