how to convert .ai image to .jpg

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
petercoloney

how to convert .ai image to .jpg

Post by petercoloney »

hi,

i was able to convert the images from .ai to .jpg individually, but dynamically through forms i was able to convert first image but the second image also contains the contains of the first image when i try to upload the image for the second time.

help me out..... what am i doing wrong?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to convert .ai image to .jpg

Post by anthony »

More than likely it is your 'environment' in the forms.

It is a different environment, with different environment variables. PATH, LD_LIBRAY_PATH, HOME, etc etc etc.

This is not strictly an ImageMagick problem, but a usage from the forms environment problem.

try running and viewing the output of command like

Code: Select all

    pwd
    id
    groups
    env
and seeing ho they differ. Also watch permissions, especially if the 'id' or currnet user name' is different!

none of this is to do specifically with ImageMagick itself!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to convert .ai image to .jpg

Post by anthony »

ai images are simple a special case of postscript.

Your need ghostscript installed and working for IM to convert it.

If you have it working on command line but not on the web, though you have an environment problem. Directory not writable, PATH not correct, etc etc etc.

Check the output of

Code: Select all

convert -list delegate
and see if it hardcoded the path to 'gs', other wise it is using the PATH for the environment Im is called from.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
petercoloney

Re: how to convert .ai image to .jpg

Post by petercoloney »

hi anthony,

i have a list of .ai file but strangely i was able to convert only one image from the command prompt to .jpg image, so i dont think their is problem with gs.

but when im trying to convert the other images i failing to convert to .jpg format.

i have installed
ImageMagick-6.5.4-3-Q16-windows-dll.exe
and gs864w32.exe on my windows system.

when im trying to convert other images it gives the following message:
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
convert: Postscript delegate failed


so whats the problem?

waiting for your reply.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to convert .ai image to .jpg

Post by anthony »

It really seems like a ghostscript problem

try runing "gs" without IM

Code: Select all

gs image.ai
It is very raw way of doing things but it is a starting point.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
petercoloney

Re: how to convert .ai image to .jpg

Post by petercoloney »

hi anthony,

when i execute the gs image.ai i get error message as not recognisable internal or external command.


when i give the image path i get error message as no such file or directory @ps.c/ReadPSImage/744

so what the problem now.....

waiting for your reply........
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to convert .ai image to .jpg

Post by anthony »

Either you gs is not installed correctly, which is your problem all along.

Or your .ai image is not correct postscript (it should be).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
petercoloney

Re: how to convert .ai image to .jpg

Post by petercoloney »

hi anthony,

i got the solution. its seems a problem with the mode in which the .ai image is saved.


can you tell me how to find the resolution for png and jpg using im php code.

thanks for the reply.
Heiler81
Posts: 63
Joined: 2009-03-12T01:52:24-07:00
Authentication code: 8675309
Location: Germany, Stuttgart

Re: how to convert .ai image to .jpg

Post by Heiler81 »

If done the convert without any problems in the 6.5.4 with win and unix. If GS (8.64) works it can be done.

convert test.ai test.jpg

(Windows XP and Unix Solaris 10 tested)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to convert .ai image to .jpg

Post by anthony »

petercoloney wrote:can you tell me how to find the resolution for png and jpg using im php code.
Postscript being a vector format does not encode a default density or resolution.
IM defaults to 72 dpi for images unless a -density setting is given before reading.

The only time resolution becomes an issue is when you are generating the raster image for a specific device (screen, printer, PDF, photo-printer), OR the postscript has a raster image (such as a photo) embedded in it.

I have not found any solution to determining the 'ideal' density needed for extacting the embedded photo perfectly. I have not even found a program to extract the raw image data (the raster data) directly from postscript files, though that should be posible!

If you do find a solution, or anyone can help, please let me and everyone else on the forum know!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply