# HG changeset patch # User Rik # Date 1531702554 25200 # Node ID 306e2ce55f27cd5467d8250b62ee069f7ca2fed4 # Parent 6fb384c855c1f97b17f921ca4d7d9a23adbd1fd6 Use compression by default for printing TIFF images (bug #54290). Add the rest of Ghostscript TIFF devices to the list Octave maintains so they can be used. * __ghostscript__.m: Enable lzw compression for any "tiffscaled" output device. * __print_parse_opts__.m (gs_device_list): Add more TIFF-related Ghostscript devices to list. * __print_parse_opts__.m (gs_aliases): Change device for "tiff" format to "tiffscaled24". diff -r 6fb384c855c1 -r 306e2ce55f27 scripts/plot/util/private/__ghostscript__.m --- a/scripts/plot/util/private/__ghostscript__.m Sun Jul 15 19:51:23 2018 +0200 +++ b/scripts/plot/util/private/__ghostscript__.m Sun Jul 15 17:55:54 2018 -0700 @@ -76,6 +76,10 @@ gs_opts = sprintf ("%s -dLanguageLevel=%d", gs_opts, opts.level); endif + if (strfind (opts.device, "tiffscaled")) + gs_opts = [gs_opts " -sCompression=lzw"]; + endif + if (opts.antialiasing && isempty (strfind (opts.device, "write"))) ## Apply anti-aliasing to all bitmap formats/devices gs_opts = sprintf ("%s -dTextAlphaBits=%d -dGraphicsAlphaBits=%d", diff -r 6fb384c855c1 -r 306e2ce55f27 scripts/plot/util/private/__print_parse_opts__.m --- a/scripts/plot/util/private/__print_parse_opts__.m Sun Jul 15 19:51:23 2018 +0200 +++ b/scripts/plot/util/private/__print_parse_opts__.m Sun Jul 15 17:55:54 2018 -0700 @@ -616,10 +616,13 @@ "pcxcmyk"; "pcxgray"; "pcxmono"; "pdfwrite"; "pgm"; ... "pgmraw"; "pgnm"; "pgnmraw"; "png16"; "png16m"; ... "png256"; "png48"; "pngalpha"; "pnggray"; "pngmono"; ... - "pnm"; "pnmraw"; "ppm"; "ppmraw"; "pswrite"; ... - "ps2write"; "tiff12nc"; "tiff24nc"; "tiff32nc"; ... - "tiffcrle"; "tiffg3"; "tiffg32d"; "tiffg4"; ... - "tiffgray"; "tifflzw"; "tiffpack"; "tiffsep"}; + "pnm"; "pnmraw"; "ppm"; "ppmraw"; "pswrite"; "ps2write"; ... + "tiff12nc"; "tiff24nc"; "tiff32nc"; "tiff48nc"; ... + "tiff64nc"; "tiffcrle"; "tiffg3"; "tiffg32d"; "tiffg4"; ... + "tiffgray"; "tifflzw"; "tiffpack"; "tiffscaled"; ... + "tiffscaled24"; "tiffscaled32"; "tiffscaled4"; ... + "tiffscaled8"; "tiffsep"; "tiffsep1" }; + endfunction function aliases = gs_aliases () @@ -635,6 +638,6 @@ aliases.ps2 = "ps2write"; aliases.psc = "ps2write"; aliases.psc2 = "ps2write"; - aliases.tiff = "tiff24nc"; + aliases.tiff = "tiffscaled24"; aliases.tiffn = "tiff24nc"; endfunction