[poppler] PDF to PPM: Page height differs between 32bit and 64bit systems
James Cloos
cloos at jhcloos.com
Wed May 14 15:15:03 PDT 2014
>>>>> "D" == Dyweni <- Poppler <7FdqWGq4fE8x at dyweni.com>> writes:
D> pg_h = 0x1.9c80000000001p+10
That shows the single extra bit. 13 hex digits to the right, so the
least significant bit of a double (aka _Float64).
If you replace:
h = (int)ceil(pg_h)
with:
h = (int)ceilf((float)pg_h)
it should avoid the rounding bug.
(pg_w should get the same treatment.)
Or perhaps pg_h and pg_w should get a (double)(float) treatment earlier
in the code.
A more accurate treatment would round fewer of the least significant
bits, but casting to float and back still leaves 24 bits of resolution.
-JimC
--
James Cloos <cloos at jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6
More information about the poppler
mailing list