Browse Source

Fixes detect size if crop whitespace

master
Alexander Demidov 6 years ago
parent
commit
14d766e34e
  1. 6
      resize.py

6
resize.py

@ -22,8 +22,14 @@ try:
im = im.convert() im = im.convert()
if args.width is not None or args.height is not None: if args.width is not None or args.height is not None:
if args.width is None: if args.width is None:
if args.crop and args.crop == CROP_WHITESPACE:
size = (int(im.size[0]), args.height)
else:
size = (int(im.size[0] * args.height / im.size[1]), args.height) size = (int(im.size[0] * args.height / im.size[1]), args.height)
elif args.height is None: elif args.height is None:
if args.crop and args.crop == CROP_WHITESPACE:
size = (args.width, int(im.size[1]))
else:
size = (args.width, int(im.size[1] * args.width / im.size[0])) size = (args.width, int(im.size[1] * args.width / im.size[0]))
else: else:
size = (args.width, args.height) size = (args.width, args.height)

Loading…
Cancel
Save