summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gs/Resource/Init/pdf_base.ps24
-rw-r--r--gs/Resource/Init/pdf_draw.ps10
2 files changed, 10 insertions, 24 deletions
diff --git a/gs/Resource/Init/pdf_base.ps b/gs/Resource/Init/pdf_base.ps
index 0e40eff93..da8db02e3 100644
--- a/gs/Resource/Init/pdf_base.ps
+++ b/gs/Resource/Init/pdf_base.ps
@@ -998,29 +998,6 @@ currentdict /pdf_rules_dict undef
998 } if 998 } if
999} bind def 999} bind def
1000 1000
1001% When used with a PDF image dict, the JPXDecode filter needs to know
1002% about any ColorSpace entries, since this overrides whatever is in
1003% the image stream itself. We therefore propagate any such key into
1004% a filter's DecodeParms.
1005/jpxparmfix { % <streamdict> <readdata?> jpxparmfix <streamdict <readdata?>
1006 1 index /Filter .knownget
1007 { /JPXDecode eq % we only need to do this for JPXDecode filters
1008 % TODO: handle filter arrays
1009 {
1010 1 index /ColorSpace knownoget {
1011 2 index /DecodeParms knownoget {
1012 % insert in the existing DecodeParms dict
1013 /ColorSpace 3 -1 roll put
1014 }{
1015 1 dict % need to create a custom DecodeParms dict
1016 dup /ColorSpace 4 -1 roll put
1017 2 index exch /DecodeParms exch put
1018 } ifelse
1019 } if
1020 } if
1021 } if
1022} bind def
1023
1024% Resolve a stream dictionary to a PostScript stream. 1001% Resolve a stream dictionary to a PostScript stream.
1025% Streams with no filters require special handling: 1002% Streams with no filters require special handling:
1026% - Whether we are going to interpret the stream, or If we are just 1003% - Whether we are going to interpret the stream, or If we are just
@@ -1029,7 +1006,6 @@ currentdict /pdf_rules_dict undef
1029% Note that, in general, resolving a stream repositions PDFfile. 1006% Note that, in general, resolving a stream repositions PDFfile.
1030% Clients must save and restore the position of PDFfile themselves. 1007% Clients must save and restore the position of PDFfile themselves.
1031/resolvestream { % <streamdict> <readdata?> resolvestream <stream> 1008/resolvestream { % <streamdict> <readdata?> resolvestream <stream>
1032 jpxparmfix
1033 1 index /F knownoget { 1009 1 index /F knownoget {
1034 % This stream is stored on an external file. 1010 % This stream is stored on an external file.
1035 (r) file 3 -1 roll 1011 (r) file 3 -1 roll
diff --git a/gs/Resource/Init/pdf_draw.ps b/gs/Resource/Init/pdf_draw.ps
index afef79168..b4f7e383a 100644
--- a/gs/Resource/Init/pdf_draw.ps
+++ b/gs/Resource/Init/pdf_draw.ps
@@ -1316,7 +1316,17 @@ currentdict /jp2_csp_dict .undef
1316 } ifelse 1316 } ifelse
1317 4 2 roll put % <resdict> obj 1317 4 2 roll put % <resdict> obj
1318 } { 1318 } {
1319 % <resdict> <key> <value>
1319 mark 3 1 roll .dicttomark % <resdict> obj 1320 mark 3 1 roll .dicttomark % <resdict> obj
1321 1 index /Filter knownoget {
1322 dup type /arraytype eq {
1323 length array % <resdict> obj [...]
1324 dup dup length 1 sub % <resdict> obj [...] [...] len-1
1325 4 -1 roll put % <resdict> [... obj]
1326 } {
1327 pop
1328 } ifelse
1329 } if
1320 } ifelse 1330 } ifelse
1321 1 index exch 1331 1 index exch
1322 /DecodeParms exch put % <resdict> 1332 /DecodeParms exch put % <resdict>