Add --quality option.
This commit is contained in:
parent
8734dc0a96
commit
12d30a88de
1 changed files with 2 additions and 1 deletions
3
rejpg.py
3
rejpg.py
|
@ -31,7 +31,7 @@ def rejpg_argparse(args):
|
||||||
|
|
||||||
i = imagetools.rotate_by_exif(i)
|
i = imagetools.rotate_by_exif(i)
|
||||||
|
|
||||||
i.save(bytesio, format='jpeg', quality=80)
|
i.save(bytesio, format='jpeg', quality=args.quality)
|
||||||
|
|
||||||
bytesio.seek(0)
|
bytesio.seek(0)
|
||||||
new_bytes = bytesio.read()
|
new_bytes = bytesio.read()
|
||||||
|
@ -51,6 +51,7 @@ def main(argv):
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
parser.add_argument('patterns', nargs='+', default={'*.jpg', '*.jpeg'})
|
parser.add_argument('patterns', nargs='+', default={'*.jpg', '*.jpeg'})
|
||||||
|
parser.add_argument('--quality', type=int, default=80)
|
||||||
parser.add_argument('--recurse', action='store_true')
|
parser.add_argument('--recurse', action='store_true')
|
||||||
parser.set_defaults(func=rejpg_argparse)
|
parser.set_defaults(func=rejpg_argparse)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue