Adjust Album Artwork compression settings

This commit is contained in:
nutty
2026-08-10 19:57:39 +10:00
parent 578a05f2c1
commit 1c934f7e1e
+9 -1
View File
@@ -298,7 +298,15 @@ try:
img = Image.open(io.BytesIO(buffer)) img = Image.open(io.BytesIO(buffer))
if img.mode in ("RGBA", "P"): if img.mode in ("RGBA", "P"):
img = img.convert("RGB") img = img.convert("RGB")
img.save(thumb_path, "JPEG", quality=50)
# Save at full resolution, but use faster compression settings
img.save(
thumb_path,
"JPEG",
quality=40, # Sweet spot for small size / high visual fidelity
subsampling=2, # Faster compression algorithm for low-end CPUs
optimize=False # Skips the extra CPU pass
)
# Update cache hash # Update cache hash
get_all_media_info.cache[safe_app_id] = img_hash get_all_media_info.cache[safe_app_id] = img_hash