Skip to content

Commit 6b3a9c9

Browse files
committed
deleted unused images in /static/images/rc and /static/images/rv
1 parent 8de3102 commit 6b3a9c9

File tree

225 files changed

+16
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+16
-6
lines changed

build/image_report.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,22 @@ def scan_file(path: str, verbose: bool = True) -> list:
7676
print(f"Checking for images not found in '{args.pathname}' that are in '{args.find_unused[0]}'")
7777

7878
unused_images = []
79+
total_images = 0
7980

8081
for root, dirs, files in os.walk(args.find_unused[0]):
8182
for file in files:
82-
if (file.endswith(".png") or file.endswith(".jpg") or file.endswith(".webp")) and not any(file in img for img in unique_images):
83-
img_filepath = os.path.join(root, file)
84-
print(f" Image '{img_filepath}' not found in '{args.pathname}'")
85-
unused_images.append(img_filepath)
86-
87-
print(f"Found {len(unused_images)} unused images.")
83+
if (file.endswith(".png") or file.endswith(".jpg") or file.endswith(".webp")):
84+
total_images += 1
85+
if not any(file in img for img in unique_images):
86+
img_filepath = os.path.join(root, file)
87+
print(f" Image '{img_filepath}' not found in '{args.pathname}'")
88+
unused_images.append(img_filepath)
89+
90+
print(f"Found {len(unused_images)} unused images out of {total_images} images in '{args.find_unused[0]}.'")
91+
92+
if len(unused_images) > 0:
93+
print("Do you want to remove these images? (y/n) (DO NOT DO ON MAIN BRANCH!)")
94+
if input().lower() == "y":
95+
for img in unused_images:
96+
os.remove(img)
97+
print(f"Removed '{img}'")
-23.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-44.2 KB
Binary file not shown.

static/images/rc/account_number.png

-39.8 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)