diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc index 552a3b15edfdedcfaa5834bdfa8aa23e12534eb7..c438ce33ac57cac9993db65dcdb412426d5815b9 100644 --- a/utils/ImageOutputDev.cc +++ b/utils/ImageOutputDev.cc @@ -25,6 +25,7 @@ // Copyright (C) 2013 Hib Eris <hib@hiberis.nl> // Copyright (C) 2017 Caolán McNamara <caolanm@redhat.com> // Copyright (C) 2018 Andreas Gruenbacher <agruenba@redhat.com> +// Copyright (C) 2020 mrbax <12640-mrbax@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