summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2012-02-25 14:54:03 -0500
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:54:23 +0000
commitffd1dc7bccdf7b7f1332c1dca64cdbec91593d55 (patch)
tree2722f923e9b22ab3d3f0506d732e96a811046f4b
parentb28494adf4f9a7440aecd4ffa26f53d35fa39842 (diff)
Bug 692878: Convert Type 4 image with invalid mask to Type 1
Improve the revision 3de55841eefb38c751772ac767c5abab155d7d91. Convert Type 4 images with invalid /Mask attribute to Type 1 images. Previous version used the mask [1 0] in such cases, which was not compatible with pdfwrite.
-rw-r--r--gs/Resource/Init/pdf_draw.ps9
1 files changed, 7 insertions, 2 deletions
diff --git a/gs/Resource/Init/pdf_draw.ps b/gs/Resource/Init/pdf_draw.ps
index 6f20571a5..50bde195a 100644
--- a/gs/Resource/Init/pdf_draw.ps
+++ b/gs/Resource/Init/pdf_draw.ps
@@ -1582,7 +1582,7 @@ currentdict /last-ditch-bpc-csp undef
dup 0 oget
dup 0 lt exch 1 BitsPerComponent bitshift ge or {
% First component is invalid - AR9 ignores the mask
- pop [1 0] % no-op mask
+ pop //null
} {
% Second component is invalid; AR9 replaces it with 1.
[ exch 0 oget 1 ]
@@ -1592,7 +1592,12 @@ currentdict /last-ditch-bpc-csp undef
[ exch { 1 BitsPerComponent bitshift 1 sub and } forall ]
} ifelse
} if
- /MaskColor exch def
+ dup //null ne {
+ /MaskColor exch def
+ } {
+ pop
+ /ImageType 1 def
+ } ifelse
} {
% Mask is a stream, another Image XObject.
% Stack: datasource imagemask(false) maskstreamdict