utils/ImageOutputDev.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 51151d41429de809235492bece87dd2d726c1a4e Author: mrbax <12640-mr...@users.noreply.gitlab.freedesktop.org> Date: Sat Dec 12 22:08:47 2020 +0100 pdfimages: Account for rotation in PPI calculation Closes: https://gitlab.freedesktop.org/poppler/poppler/-/issues/3 diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc index 552a3b15..c438ce33 100644 --- a/utils/ImageOutputDev.cc +++ b/utils/ImageOutputDev.cc @@ -25,6 +25,7 @@ // Copyright (C) 2013 Hib Eris <h...@hiberis.nl> // Copyright (C) 2017 Caolán McNamara <caol...@redhat.com> // Copyright (C) 2018 Andreas Gruenbacher <agrue...@redhat.com> +// Copyright (C) 2020 mrbax <12640-mr...@users.noreply.gitlab.freedesktop.org> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -227,10 +228,10 @@ void ImageOutputDev::listImage(GfxState *state, Object *ref, Stream *str, int wi } const 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 width2 = sqrt(mat[0] * mat[0] + mat[1] * mat[1]); + double height2 = sqrt(mat[2] * mat[2] + mat[3] * mat[3]); + double xppi = fabs(width * 72.0 / width2); + double yppi = fabs(height * 72.0 / height2); if (xppi < 1.0) printf("%5.3f ", xppi); else _______________________________________________ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler