Mercurial > octave
changeset 25626:306e2ce55f27
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".
author | Rik <rik@octave.org> |
---|---|
date | Sun, 15 Jul 2018 17:55:54 -0700 |
parents | 6fb384c855c1 |
children | 45bd3edcbbcf |
files | scripts/plot/util/private/__ghostscript__.m scripts/plot/util/private/__print_parse_opts__.m |
diffstat | 2 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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",
--- 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