[poppler] PDF to PPM: Page height differs between 32bit and 64bit systems

James Cloos cloos at jhcloos.com
Fri May 16 21:44:59 PDT 2014


I took a closer look at this.

Pdftoppm needs to scale the height and width from ps points to pixels at
the specified resolution (which defaults to 150 dpi).

The code is careful to avoid overflow, but given the magnitudes of the
page sizes and the dpis, overflow is very unlikely.  Even on platforms
where double is a _Float32 or _Decimal32 rather than the typical _Float64.

Undoing that care, to have the code first multiply by the dpi and then
divide by 72.0, fixes this.

As requested, I posted a bz with a pull request to fix this at:

  https://bugs.freedesktop.org/show_bug.cgi?id=78809

Try:

  git pull git://people.freedesktop.org/~cloos/poppler.git refs/tags/roundoff

  utils/pdftocairo.cc | 4 ++--
  utils/pdftoppm.cc   | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

It'll eventual show up at:

    http://cgit.freedesktop.org/~cloos/poppler/log/?h=roundoff

-JimC
--
James Cloos <cloos at jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6


More information about the poppler mailing list