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

Albert Astals Cid aacid at kde.org
Wed May 14 15:51:14 PDT 2014


El Dimecres, 14 de maig de 2014, a les 18:15:03, James Cloos va escriure:
> >>>>> "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.

Once you guys reach a conclusion of what's the better patch can you please 
open a bug since it's easier for me to track there what patches need 
review/commiting than on the mailing list?

Thanks!

Cheers,
  Albert

> 
> 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
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler



More information about the poppler mailing list