From 1b8a2963bd93117e72d2a5159e739a77e455c37f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 8 Feb 2011 08:37:25 +0000 Subject: Only interpolate upscaled images when the interpolate flag is set in the image dictionary. --- draw/imagedraw.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'draw') diff --git a/draw/imagedraw.c b/draw/imagedraw.c index d2468b38..c44a3ba1 100644 --- a/draw/imagedraw.c +++ b/draw/imagedraw.c @@ -289,12 +289,15 @@ fz_paintimageimp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *img, fz_matrix ctm, /* turn on interpolation for upscaled and non-rectilinear transforms */ dolerp = 0; - if (!fz_isrectilinear(ctm)) - dolerp = 1; - if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w) - dolerp = 1; - if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h) - dolerp = 1; + if (img->interpolate) + { + if (!fz_isrectilinear(ctm)) + dolerp = 1; + if (sqrtf(ctm.a * ctm.a + ctm.b * ctm.b) > img->w) + dolerp = 1; + if (sqrtf(ctm.c * ctm.c + ctm.d * ctm.d) > img->h) + dolerp = 1; + } bbox = fz_roundrect(fz_transformrect(ctm, fz_unitrect)); bbox = fz_intersectbbox(bbox, scissor); -- cgit v1.2.3