diff options
author | Tor Andersson <tor@ghostscript.com> | 2011-02-08 08:37:25 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2011-02-08 08:37:25 +0000 |
commit | 1b8a2963bd93117e72d2a5159e739a77e455c37f (patch) | |
tree | 8aa94c005529ad52c92d07cbefdc7fe3be76de51 /draw | |
parent | 385b171b8bef464bbf652c81d85728ccb064ab86 (diff) | |
download | mupdf-1b8a2963bd93117e72d2a5159e739a77e455c37f.tar.xz |
Only interpolate upscaled images when the interpolate flag is set in the image dictionary.
Diffstat (limited to 'draw')
-rw-r--r-- | draw/imagedraw.c | 15 |
1 files changed, 9 insertions, 6 deletions
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); |