precision of dimension using identify

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
baskote

precision of dimension using identify

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post 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.
baskote

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Here's what you want:
  • identify -format "%[HiResBoundingBox]" demos/verizon.ps
baskote

Post by baskote »

thanks a lot


Markus
Post Reply