Page 1 of 1

precision of dimension using identify

Posted: 2007-01-03T07:45:46-07:00
by baskote
Hi,

we are using identify to retrieve the dimension of pdf files and the precision is not exact enough for us.

the command we are using is "identify -format %w#%h"

In the source code of "icoders/pdf.c" i found that you will round the values.

Code: Select all

/*
      Set PDF render geometry.
    */
    page.width=(unsigned long) (bounds.x2-bounds.x1+0.5);
    page.height=(unsigned long) (bounds.y2-bounds.y1+0.5);
So my question is it possible to retrieve somehow the original values without rounding them ? Or possible to retrieve the bounds ?


Any help would be welcome

Markus

Posted: 2007-01-03T10:36:24-07:00
by magick
We'll add a patch to ImageMagick 6.3.1-6 Beta to return the high-resolution bounding box for Postscript and PDF images. It will be stored as an image attribute so use
  • identify -verbose
to retrieve it. The updated Beta will be available by tommorrow.

Posted: 2007-01-04T08:23:43-07:00
by baskote
First of all thanks for your fast response and this very quick enhancement. It will increase my trust in imagemagick and to this great community of developers.

I have one question to "-verbose" left. is the speed of "-verbose" behaviour same than "-format" ?

Thanks a lot


markus

Posted: 2007-01-04T09:36:01-07:00
by magick
Here's what you want:
  • identify -format "%[HiResBoundingBox]" demos/verizon.ps

Posted: 2007-01-05T06:14:51-07:00
by baskote
thanks a lot


Markus