Skip to content

Commit ae61879

Browse files
committed
Filesize checks
1 parent 8d30730 commit ae61879

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

utils/check_image_sizes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ def get_size(url):
111111

112112
# Check for large images above threshold
113113
large_images = [
114-
(size_kb, fmt, pages, url) for size_kb, fmt, pages, url in all_images if size_kb / 1024 >= threshold_mb
114+
(size_kb, fmt, pages, url) for size_kb, fmt, pages, url in all_images if size_kb >= threshold_kb
115115
]
116116

117117
if large_images:
118-
print(f"⚠️ Found {len(large_images)} images >= {threshold_mb} MB")
119-
output = [f"*{len(large_images)} images >= {threshold_mb} MB on https://{website}*"]
118+
print(f"\n⚠️ Found {len(large_images)} images >= {threshold_kb} KB")
119+
output = [f"*{len(large_images)} images >= {threshold_kb} KB on https://{website}*"]
120120
for size_kb, fmt, pages, url in large_images[:10]:
121121
# Extract filename from URL for concise display
122122
filename = Path(urlparse(url).path).name or "image"
@@ -130,7 +130,7 @@ def get_size(url):
130130
f.write(f"IMAGE_RESULTS<<EOF\n{result}\nEOF\n")
131131
return 1
132132
else:
133-
print(f"✅ No images >= {threshold_mb} MB")
133+
print(f"\n✅ No images >= {threshold_kb} KB")
134134
return 0
135135

136136

0 commit comments

Comments
 (0)