When using the DCTEncode filter, Ghostscript crashes if the QuantTables parameter is specified. Adobe Distiller 6.0 is happy with the code. If QuantTables parameter is removed (ie using default tables), Ghostscript is happy. %-- Edited code example (incomplete): /DataSource { ... } def % provides one row of image data, % ie SamplesPerPixel * ImageWidth bytes /QTable1 <0302020302020303030304030304050805050404050A070706080C0A0C0C0B0A0B0B0D0E12100D0E110E0B0B1016101113141515150C0F171816141812141514> def /QTable2 <03040405040509050509140D0B0D1414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414> def /SamplesPerPixel 3 def % Or 1 for B&W (DCTEncode_temp.jpg) (w) file << /Columns ImageWidth /Rows ImageHeight /Colors SamplesPerPixel /QFactor 1.0 /QuantTables [ QTable1 SamplesPerPixel 1 sub { QTable2 } repeat ] >> /DCTEncode filter ImageHeight { dup DataSource writestring } repeat closefile % ... %--
Please attach a full sample.
The sample code is good enough. The problem is reproduced. Thank you for using and testing Ghostscript.
Created attachment 7096 [details] patch Fix a cut-ant-paste error in setting QuantTables for JPXEncode filter.
The patch has been committed as a rev. 12003.