Fix for 687056, Cannot display PDF file

Alex Cherepanov <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Handle the case of missing /BitsPerComponent key.
Fix bug 687956.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
pdf_draw.ps.diff (text/plain, 1.1 KB)
Index: gs/lib/pdf_draw.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_draw.ps,v
retrieving revision 1.75
diff -b -u -r1.75 pdf_draw.ps
--- gs/lib/pdf_draw.ps	16 Sep 2003 07:11:15 -0000	1.75
+++ gs/lib/pdf_draw.ps	30 Sep 2003 09:05:50 -0000
@@ -821,7 +821,8 @@
   begin
   /Width 2 copy oget def
   /Height 2 copy oget def
-  /BitsPerComponent 2 copy oget def
+		% Handle missing BitsPerComponent later.
+  /BitsPerComponent 2 copy knownoget { def } { pop } ifelse
   /Interpolate 2 copy knownoget { def } { pop } ifelse
   makeimagekeys
 } bdef
@@ -838,9 +839,7 @@
 		% Decode is required for the PostScript image operators.
                 % AI8 writes bogus decode array [0 1 0 0 0 0 0 0]
     /Decode 2 copy knownoget { 0 2 getinterval } { //01_1 } ifelse def
-		% BitsPerComponent may be missing for masks.
-		% The spec requires it, but some producers omit it, and
-		% Acrobat Reader doesn't care.
+		% BitsPerComponent is optional for masks.
     /BitsPerComponent 2 copy known { pop } { 1 def } ifelse
     true
   } {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.