tianyunperfect 1 year ago
parent
commit
b73e803870
1 changed files with 8 additions and 8 deletions
  1. 8 8
      project/compress_dir_img.py

+ 8 - 8
project/compress_dir_img.py

@@ -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")