vwebp: remove the -fit option (and make it default)

BUG=webp:433

Change-Id: I18476ba0ada0184d4d9e94060d601002bfa006da
This commit is contained in:
Pascal Massimino 2019-06-05 21:43:23 +02:00
parent 1394a2bb86
commit b9be7e65f8
3 changed files with 2 additions and 13 deletions

1
README
View File

@ -405,7 +405,6 @@ Options are:
-dither <int> dithering strength (0..100), default=50 -dither <int> dithering strength (0..100), default=50
-noalphadither disable alpha plane dithering -noalphadither disable alpha plane dithering
-usebgcolor .. display background color -usebgcolor .. display background color
-fit ......... downscale large images to preserve aspect ratio
-mt .......... use multi-threading -mt .......... use multi-threading
-info ........ print info -info ........ print info
-h ........... this help message -h ........... this help message

View File

@ -72,7 +72,6 @@ static struct {
WebPIterator prev_frame; WebPIterator prev_frame;
WebPChunkIterator iccp; WebPChunkIterator iccp;
int viewport_width, viewport_height; int viewport_width, viewport_height;
int fit; // if true, rescale large images to preserve aspect ratio.
} kParams; } kParams;
static void ClearPreviousPic(void) { static void ClearPreviousPic(void) {
@ -431,7 +430,7 @@ static void StartDisplay(void) {
#endif #endif
screen_width = glutGet(GLUT_SCREEN_WIDTH); screen_width = glutGet(GLUT_SCREEN_WIDTH);
screen_height = glutGet(GLUT_SCREEN_HEIGHT); screen_height = glutGet(GLUT_SCREEN_HEIGHT);
if ((width > screen_width || height > screen_height) && kParams.fit) { if (width > screen_width || height > screen_height) {
if (width > screen_width) { if (width > screen_width) {
height = (height * screen_width + width - 1) / width; height = (height * screen_width + width - 1) / width;
width = screen_width; width = screen_width;
@ -468,7 +467,6 @@ static void Help(void) {
" -dither <int> dithering strength (0..100), default=50\n" " -dither <int> dithering strength (0..100), default=50\n"
" -noalphadither disable alpha plane dithering\n" " -noalphadither disable alpha plane dithering\n"
" -usebgcolor .. display background color\n" " -usebgcolor .. display background color\n"
" -fit ......... downscale large images to preserve aspect ratio\n"
" -mt .......... use multi-threading\n" " -mt .......... use multi-threading\n"
" -info ........ print info\n" " -info ........ print info\n"
" -h ........... this help message\n" " -h ........... this help message\n"
@ -497,8 +495,6 @@ int main(int argc, char *argv[]) {
kParams.use_color_profile = 1; kParams.use_color_profile = 1;
// Background color hidden by default to see transparent areas. // Background color hidden by default to see transparent areas.
kParams.draw_anim_background_color = 0; kParams.draw_anim_background_color = 0;
// By default don't rescale too-large input images to preserve aspect ratio.
kParams.fit = 0;
for (c = 1; c < argc; ++c) { for (c = 1; c < argc; ++c) {
int parse_error = 0; int parse_error = 0;
@ -515,8 +511,6 @@ int main(int argc, char *argv[]) {
config->options.alpha_dithering_strength = 0; config->options.alpha_dithering_strength = 0;
} else if (!strcmp(argv[c], "-usebgcolor")) { } else if (!strcmp(argv[c], "-usebgcolor")) {
kParams.draw_anim_background_color = 1; kParams.draw_anim_background_color = 1;
} else if (!strcmp(argv[c], "-fit")) {
kParams.fit = 1;
} else if (!strcmp(argv[c], "-dither") && c + 1 < argc) { } else if (!strcmp(argv[c], "-dither") && c + 1 < argc) {
config->options.dithering_strength = config->options.dithering_strength =
ExUtilGetInt(argv[++c], 0, &parse_error); ExUtilGetInt(argv[++c], 0, &parse_error);

View File

@ -1,5 +1,5 @@
.\" Hey, EMACS: -*- nroff -*- .\" Hey, EMACS: -*- nroff -*-
.TH VWEBP 1 "May 28, 2019" .TH VWEBP 1 "June 5, 2019"
.SH NAME .SH NAME
vwebp \- decompress a WebP file and display it in a window vwebp \- decompress a WebP file and display it in a window
.SH SYNOPSIS .SH SYNOPSIS
@ -42,10 +42,6 @@ to smooth the gradients. This flag will prevent this dithering.
Fill transparent areas with the bitstream's own background color instead of Fill transparent areas with the bitstream's own background color instead of
checkerboard only. Default is white for non-animated images. checkerboard only. Default is white for non-animated images.
.TP .TP
.B \-fit
If an image is larger than the display dimension, rescale it to preserve
the aspect ratio.
.TP
.B \-mt .B \-mt
Use multi-threading for decoding, if possible. Use multi-threading for decoding, if possible.
.TP .TP