Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 656
    • Issues 656
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #608

Closed
Open
Created Jan 30, 2018 by Bugzilla Migration User@bugzilla-migration

pdfimages adds a superfluous 0.5 to image ppi shown using -list (patch provided)

Submitted by fre..@..et.com

Assigned to poppler-bugs

Link to original bug (#104861)

Description

Adding 0.5 to a double before formatting with "%5.0f" results in a rounding error. Presumably it was originally done before truncating to int.

--- utils/ImageOutputDev.cc.old 2018-01-30 16:38:42.179170000 +0200 +++ utils/ImageOutputDev.cc 2018-01-30 16:39:13.506750000 +0200 @@ -234,13 +234,13 @@ double *mat = state->getCTM(); double width2 = mat[0] + mat[2]; double height2 = mat[1] + mat[3];

  • double xppi = fabs(width*72.0/width2) + 0.5;
  • double yppi = fabs(height*72.0/height2) + 0.5;
  • double xppi = fabs(width*72.0/width2);
  • double yppi = fabs(height*72.0/height2); if (xppi < 1.0) printf("%5.3f ", xppi); else printf("%5.0f ", xppi); if (yppi < 1.0) printf("%5.3f ", yppi); else printf("%5.0f ", yppi);
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking