Page 1 of 1

How do you do "-density"?

Posted: 2008-04-23T00:58:23-07:00
by nextbigthing
I'm reading in .ai and .pdf files and they look pretty bad. How can I set the -density using MagickWand?

Also,
I read in my searches about this that the default dpi is 72. Can this be changed?

Thanks in advance,
Eric James

Re: How do you do "-density"?

Posted: 2008-04-23T08:52:46-07:00
by el_supremo
The -density option sets the x and y resolution of the image. You can set the units and resolution of the image with these functions which both return a Boolean result. Call them before you read the image.
// units are PixelsPerInchResolution or PixelsPerCentimeterResolution - I don't know the PHP name for these constants (I use C).
MagickSetImageUnits(wand,PixelsPerInchResolution);
// x and y resolution are doubles.
MagickSetImageResolution(wand,300,300);

Pete

Re: How do you do "-density"?

Posted: 2008-04-23T16:15:04-07:00
by nextbigthing
Those changed did not make a difference. For now I ended up just using exec() in php so I could use -density. A bit frustrating.

Anybody have any other info on setting -density using magickwand?

Thanks again,
Eric James

Re: How do you do "-density"?

Posted: 2008-04-26T00:18:20-07:00
by mkoppanen
I guess MagickSetResolution should be used instead of MagickSetImageResolution.