Adjust Album Artwork compression settings
This commit is contained in:
+9
-1
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user