GraphicsMagick: MogrifyImage(): Restore the original -depth beha...
GraphicsMagick Commits <[email protected]> Thu, 18 Jul 2024 15:07:37 -0500
| Newsgroups | gmane.comp.video.graphicsmagick.cvs |
|---|---|
| Message-ID | <mailman.2865.1721333275.7833.graphicsmagick-commit@lists.sourceforge.net> |
changeset 33aeb265abe4 in /hg/GraphicsMagick details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=33aeb265abe4 summary: MogrifyImage(): Restore the original -depth behavior, which only assigned an image depth property. diffstat: ChangeLog | 8 ++++++++ doc/options.imdoc | 9 ++++----- magick/command.c | 5 +++-- utilities/gm.1 | 11 +++++------ www/ChangeLog.html | 7 +++++++ www/GraphicsMagick.html | 9 ++++----- www/gm.html | 9 ++++----- 7 files changed, 35 insertions(+), 23 deletions(-) diffs (131 lines): diff -r df8e069aaaa8 -r 33aeb265abe4 ChangeLog --- a/ChangeLog Thu Jul 18 11:21:57 2024 -0500 +++ b/ChangeLog Thu Jul 18 15:07:10 2024 -0500 @@ -1,5 +1,13 @@ 2024-07-18 Bob Friesenhahn <[email protected]> + * magick/command.c (MogrifyImage): Change utility '-depth N' to a + simple image depth attribute assignment rather than also being an + image processing operation. Obtain the previous result (which + immediately modified the image pixels) using '-operator All Depth + N'. Most users use -depth in order to influence the bits/sample + of the file being written rather than as an intermediate image + processing operation. + * magick/floats.c (_Gm_convert_fp32_to_fp24): Coverity fixes for arithmetic overflow in mantissa related code. diff -r df8e069aaaa8 -r 33aeb265abe4 doc/options.imdoc --- a/doc/options.imdoc Thu Jul 18 11:21:57 2024 -0500 +++ b/doc/options.imdoc Thu Jul 18 15:07:10 2024 -0500 @@ -1711,11 +1711,10 @@ the depth of raw images whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read.</pp> -<pp>The depth option is applied to the pixels immediately so it may be -used as a form of simple compression by discarding the least significant -bits. Reducing the depth in advance may speed up color quantization, and -help create smaller file sizes when using a compression algorithm like -LZW or ZIP.</pp> +<pp> +See the -operator option for a way (via '-operator All Depth N') to +apply a depth limit to the pixels immediately rather than setting an +image attribute.</pp> </utils> diff -r df8e069aaaa8 -r 33aeb265abe4 magick/command.c --- a/magick/command.c Thu Jul 18 11:21:57 2024 -0500 +++ b/magick/command.c Thu Jul 18 15:07:10 2024 -0500 @@ -9698,8 +9698,9 @@ } if (LocaleCompare("depth",option+1) == 0) { - /* (*image)->depth = MagickAtoL(argv[++i]); */ - (void) SetImageDepth(*image,MagickAtoL(argv[++i])); + (*image)->depth = MagickAtoL(argv[++i]); + /* Below is equivalent to '-operator All Depth [value]' */ + /* (void) SetImageDepth(*image,MagickAtoL(argv[++i])); */ continue; } if (LocaleCompare("despeckle",option+1) == 0) diff -r df8e069aaaa8 -r 33aeb265abe4 utilities/gm.1 --- a/utilities/gm.1 Thu Jul 18 11:21:57 2024 -0500 +++ b/utilities/gm.1 Thu Jul 18 15:07:10 2024 -0500 @@ -1,4 +1,4 @@ -.TH gm 1 "2024/04/20" "GraphicsMagick" +.TH gm 1 "2024/07/18" "GraphicsMagick" .TP .in 15 .in 15 @@ -2045,11 +2045,10 @@ although 8 or 16 are the most common values. Use this option to specify the depth of raw images whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read. -The depth option is applied to the pixels immediately so it may be -used as a form of simple compression by discarding the least significant -bits. Reducing the depth in advance may speed up color quantization, and -help create smaller file sizes when using a compression algorithm like -LZW or ZIP. + +See the -operator option for a way (via '-operator All Depth N') to +apply a depth limit to the pixels immediately rather than setting an +image attribute. .TP .B "-descend" \fRobtain image by descending window hierarchy diff -r df8e069aaaa8 -r 33aeb265abe4 www/ChangeLog.html --- a/www/ChangeLog.html Thu Jul 18 11:21:57 2024 -0500 +++ b/www/ChangeLog.html Thu Jul 18 15:07:10 2024 -0500 @@ -41,6 +41,13 @@ <p>2024-07-18 Bob Friesenhahn <<a class="reference external" href="mailto:bfriesen%40simple.dallas.tx.us">bfriesen<span>@</span>simple<span>.</span>dallas<span>.</span>tx<span>.</span>us</a>></p> <blockquote> <ul class="simple"> +<li><p>magick/command.c (MogrifyImage): Change utility '-depth N' to a +simple image depth attribute assignment rather than also being an +image processing operation. Obtain the previous result (which +immediately modified the image pixels) using '-operator All Depth +N'. Most users use -depth in order to influence the bits/sample +of the file being written rather than as an intermediate image +processing operation.</p></li> <li><p>magick/floats.c (_Gm_convert_fp32_to_fp24): Coverity fixes for arithmetic overflow in mantissa related code.</p></li> </ul> diff -r df8e069aaaa8 -r 33aeb265abe4 www/GraphicsMagick.html --- a/www/GraphicsMagick.html Thu Jul 18 11:21:57 2024 -0500 +++ b/www/GraphicsMagick.html Thu Jul 18 15:07:10 2024 -0500 @@ -1991,11 +1991,10 @@ although 8 or 16 are the most common values. Use this option to specify the depth of raw images whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read.</font></td></tr></table> -<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td><font size="-1">The depth option is applied to the pixels immediately so it may be -used as a form of simple compression by discarding the least significant -bits. Reducing the depth in advance may speed up color quantization, and -help create smaller file sizes when using a compression algorithm like -LZW or ZIP.</font></td></tr></table> +<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td><font size="-1"> +See the -operator option for a way (via '-operator All Depth N') to +apply a depth limit to the pixels immediately rather than setting an +image attribute.</font></td></tr></table> <table BORDER=0 WIDTH="94%"> <tr> <td width="3%"><br></td> diff -r df8e069aaaa8 -r 33aeb265abe4 www/gm.html --- a/www/gm.html Thu Jul 18 11:21:57 2024 -0500 +++ b/www/gm.html Thu Jul 18 15:07:10 2024 -0500 @@ -1954,11 +1954,10 @@ although 8 or 16 are the most common values. Use this option to specify the depth of raw images whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read.</font></td></tr></table> -<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td><font size="-1">The depth option is applied to the pixels immediately so it may be -used as a form of simple compression by discarding the least significant -bits. Reducing the depth in advance may speed up color quantization, and -help create smaller file sizes when using a compression algorithm like -LZW or ZIP.</font></td></tr></table> +<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td><font size="-1"> +See the -operator option for a way (via '-operator All Depth N') to +apply a depth limit to the pixels immediately rather than setting an +image attribute.</font></td></tr></table> <table BORDER=0 WIDTH="94%"> <tr> <td width="3%"><br></td>