From ede169c72989b090f1b90edb81285ce3e943b5de Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 9 Nov 2021 00:00:35 -0800 Subject: [PATCH] Update resize.py helptext, alphabetize arguments. --- resize.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resize.py b/resize.py index 7e6a91b..caf2b93 100644 --- a/resize.py +++ b/resize.py @@ -4,6 +4,8 @@ resize Resize image files. +> resize pattern new_w new_h + pattern: Glob pattern for input files. @@ -13,6 +15,7 @@ new_h: dimension will be calculated by resizing the other side while keeping the aspect ratio. +flags: --inplace: Overwrite the input files, instead of creating _WxH names. @@ -23,11 +26,11 @@ new_h: If the input image is smaller than the requested dimensions, do nothing. Useful when globbing in a directory with many differently sized images. ---scale X: - Use this option instead of new_w, new_h. Scale the image by factor X. - --quality X: JPEG compression quality. + +--scale X: + Use this option instead of new_w, new_h. Scale the image by factor X. ''' import argparse import PIL.Image @@ -49,8 +52,8 @@ def resize( inplace=False, nearest_neighbor=False, only_shrink=False, - scale=None, quality=100, + scale=None, ): file = pathclass.Path(filename) image = PIL.Image.open(file.absolute_path) @@ -111,8 +114,8 @@ def resize_argparse(args): inplace=args.inplace, nearest_neighbor=args.nearest_neighbor, only_shrink=args.only_shrink, - scale=args.scale, quality=args.quality, + scale=args.scale, ) return 0