summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/lib/gs_img.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/lib/gs_img.ps')
-rw-r--r--Master/tlpkg/tlgs/lib/gs_img.ps20
1 files changed, 18 insertions, 2 deletions
diff --git a/Master/tlpkg/tlgs/lib/gs_img.ps b/Master/tlpkg/tlgs/lib/gs_img.ps
index 5c0c00127b0..a8a8bf774d5 100644
--- a/Master/tlpkg/tlgs/lib/gs_img.ps
+++ b/Master/tlpkg/tlgs/lib/gs_img.ps
@@ -13,7 +13,7 @@
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
-% $Id: gs_img.ps 7647 2007-01-26 16:49:00Z alexcher $
+% $Id: gs_img.ps 8242 2007-09-18 15:41:08Z leonardo $
% image, colorimage, and imagemask implementation
%
@@ -674,6 +674,21 @@ if
}
.bind systemdict begin odef end
+% An auxiliary function for checking whether an imagemask to be interpolated.
+/.is_low_resolution % <image dict> .is_low_resolution <bool>
+{ % Checking whether image pixel maps to more than 2 device pixels.
+ % The threshold 2 is arbitrary.
+ 1 exch 0 exch
+ 0 exch 1 exch
+ /ImageMatrix get dup
+ 2 {
+ 4 1 roll
+ idtransform dtransform dup mul exch dup mul add sqrt
+ } repeat
+ max
+ 2 gt % arbitrary
+} .bind def
+
%
% width height polarity matrix datasrc imagemask -
@@ -686,7 +701,8 @@ if
dup type /dicttype eq .languagelevel 2 ge and
{ dup /ImageType get
//.imagemasktypes exch .knownget
- { 1 index /ImageType get 1 eq
+ { 1 index //.is_low_resolution exec
+ 2 index /ImageType get 1 eq and
2 index /BitsPerComponent get 1 eq and
2 index /Interpolate .knownget not { false } if and
//filterdict /ImscaleDecode known and {