From 34bb332ca15d9ce605280265c6b042cef149f68d Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 17 Mar 2022 10:29:02 -0700 Subject: [PATCH] man/cwebp.1: add note about crop/resize order + normalize help text in [cd]webp Bug: webp:561 Change-Id: Id92ec4228d4933cd033b2bf68a43192532cef483 --- doc/tools.md | 4 ++-- examples/cwebp.c | 2 +- examples/dwebp.c | 2 +- man/cwebp.1 | 14 ++++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/doc/tools.md b/doc/tools.md index 5634e75f..853af819 100644 --- a/doc/tools.md +++ b/doc/tools.md @@ -64,7 +64,7 @@ Options: -qrange .... specifies the permissible quality range (default: 0 100) -crop .. crop picture with the given rectangle --resize ........ resize picture (after any cropping) +-resize ........ resize picture (*after* any cropping) -mt .................... use multi-threading if available -low_memory ............ reduce memory usage (slower encoding) -map ............. print map of extra info @@ -181,7 +181,7 @@ Other options are: -alpha_dither use alpha-plane dithering if needed -mt .......... use multi-threading -crop ... crop output with the given rectangle --resize ......... scale the output (*after* any cropping) +-resize ......... resize output (*after* any cropping) -flip ........ flip the output vertically -alpha ....... only save the alpha plane -incremental . use incremental decoding (useful for tests) diff --git a/examples/cwebp.c b/examples/cwebp.c index 927063a4..8d9b6936 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -571,7 +571,7 @@ static void HelpLong(void) { printf(" -qrange .... specifies the permissible quality range\n" " (default: 0 100)\n"); printf(" -crop .. crop picture with the given rectangle\n"); - printf(" -resize ........ resize picture (after any cropping)\n"); + printf(" -resize ........ resize picture (*after* any cropping)\n"); printf(" -mt .................... use multi-threading if available\n"); printf(" -low_memory ............ reduce memory usage (slower encoding)\n"); printf(" -map ............. print map of extra info\n"); diff --git a/examples/dwebp.c b/examples/dwebp.c index 5cfb0fb1..652de6a6 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -96,7 +96,7 @@ static void Help(void) { " -alpha_dither use alpha-plane dithering if needed\n" " -mt .......... use multi-threading\n" " -crop ... crop output with the given rectangle\n" - " -resize ......... scale the output (*after* any cropping)\n" + " -resize ......... resize output (*after* any cropping)\n" " -flip ........ flip the output vertically\n" " -alpha ....... only save the alpha plane\n" " -incremental . use incremental decoding (useful for tests)\n" diff --git a/man/cwebp.1 b/man/cwebp.1 index 34b04e09..28de4c94 100644 --- a/man/cwebp.1 +++ b/man/cwebp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH CWEBP 1 "November 17, 2021" +.TH CWEBP 1 "March 17, 2022" .SH NAME cwebp \- compress an image file to a WebP file .SH SYNOPSIS @@ -90,15 +90,17 @@ additional encoding possibilities and decide on the quality gain. Lower value can result in faster processing time at the expense of larger file size and lower compression quality. .TP -.BI \-resize " width height -Resize the source to a rectangle with size \fBwidth\fP x \fBheight\fP. -If either (but not both) of the \fBwidth\fP or \fBheight\fP parameters is 0, -the value will be calculated preserving the aspect\-ratio. -.TP .BI \-crop " x_position y_position width height Crop the source to a rectangle with top\-left corner at coordinates (\fBx_position\fP, \fBy_position\fP) and size \fBwidth\fP x \fBheight\fP. This cropping area must be fully contained within the source rectangle. +Note: the cropping is applied \fIbefore\fP any scaling. +.TP +.BI \-resize " width height +Resize the source to a rectangle with size \fBwidth\fP x \fBheight\fP. +If either (but not both) of the \fBwidth\fP or \fBheight\fP parameters is 0, +the value will be calculated preserving the aspect\-ratio. Note: scaling +is applied \fIafter\fP cropping. .TP .B \-mt Use multi\-threading for encoding, if possible.