|
@@ -54,13 +54,13 @@ def convert_to_webp(dir_path):
|
|
|
bf.tofile(open(path_expanduser, "wb"))
|
|
|
|
|
|
|
|
|
-# if __name__ == "__main__":
|
|
|
-# parser = argparse.ArgumentParser(description='Convert images to webp format.')
|
|
|
-# parser.add_argument('dir_path', type=str, help='Directory path to scan for images')
|
|
|
-#
|
|
|
-# args = parser.parse_args()
|
|
|
-#
|
|
|
-# convert_to_webp(args.dir_path)
|
|
|
+if __name__ == "__main__":
|
|
|
+ parser = argparse.ArgumentParser(description='Convert images to webp format.')
|
|
|
+ parser.add_argument('dir_path', type=str, help='Directory path to scan for images')
|
|
|
+
|
|
|
+ args = parser.parse_args()
|
|
|
+
|
|
|
+ convert_to_webp(args.dir_path)
|
|
|
|
|
|
## python compress_dir_img.py /path/to/directory
|
|
|
-convert_to_webp("/c/Users/admin")
|
|
|
+# convert_to_webp("/c/Users/admin")
|