diff options
author | clarkzjw <[email protected]> | 2023-02-07 16:25:10 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-07 16:25:10 -0800 |
commit | 5ec22acf45f812bfdfe844d90764a62c94d47313 (patch) | |
tree | 53e91d4c9dad23da2bcefc694e239456bb771540 | |
parent | 813834094d0cc8b476760be55e3db425416c0f63 (diff) | |
download | Square-5ec22acf45f812bfdfe844d90764a62c94d47313.tar.gz |
remove padding
-rwxr-xr-x | square.py | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -65,11 +65,6 @@ def drop_shadow(image, offset=(5, 5), background=0xffffff, shadow=0x444444, bord | |||
65 | 65 | ||
66 | 66 | ||
67 | if __name__ == "__main__": | 67 | if __name__ == "__main__": |
68 | parser = argparse.ArgumentParser(description="Options") | ||
69 | parser.add_argument('--padding', action=argparse.BooleanOptionalAction) | ||
70 | |||
71 | args = parser.parse_args() | ||
72 | |||
73 | files = glob.glob("*") | 68 | files = glob.glob("*") |
74 | for file in files: | 69 | for file in files: |
75 | if (file.endswith(".jpg") or file.endswith(".png")) \ | 70 | if (file.endswith(".jpg") or file.endswith(".png")) \ |
@@ -85,8 +80,5 @@ if __name__ == "__main__": | |||
85 | continue | 80 | continue |
86 | 81 | ||
87 | print("Processing {}".format(file)) | 82 | print("Processing {}".format(file)) |
88 | if args.padding is True: | 83 | result = square_size_padding(im) |
89 | result = square_size_padding(drop_shadow(im, background=0xFAFAFA, shadow=0x444444, offset=(20, 20))) | ||
90 | else: | ||
91 | result = square_size_no_padding(drop_shadow(im, background=0xFAFAFA, shadow=0x444444, offset=(20, 20))) | ||
92 | result.save("{}-result.{}".format(names[0], names[1]), quality=100) | 84 | result.save("{}-result.{}".format(names[0], names[1]), quality=100) |