From 7b117a27746962e16ef70f18bc8d31249517760e Mon Sep 17 00:00:00 2001 From: Patrick Pfeifer Date: Thu, 19 Jan 2012 14:54:48 +0100 Subject: [PATCH] Fix test for rotation --- poppler/CairoOutputDev.cc | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 03e6c06..1a5ca4f 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1530,7 +1530,11 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, cairo_get_matrix (cairo, &matrix); //XXX: it is possible that we should only do sub pixel positioning if // we are rendering fonts */ - if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) { + if (!printing && prescaleImages + /* not rotated */ + && matrix.xy == 0 && matrix.yx == 0 + /* axes not flipped / not 180 deg rotated */ + && matrix.xx > 0 && (upsideDown() ? -1 : 1) * matrix.yy > 0) { drawImageMaskPrescaled(state, ref, str, width, height, invert, interpolate, inlineImg); } else { drawImageMaskRegular(state, ref, str, width, height, invert, interpolate, inlineImg); @@ -1663,6 +1667,8 @@ void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream /* cairo does a very poor job of scaling down images so we scale them ourselves */ + LOG (printf ("drawImageMaskPrescaled %dx%d\n", width, height)); + /* this scaling code is adopted from the splash image scaling code */ cairo_get_matrix(cairo, &matrix); #if 0 -- 1.7.8.3