fix: ruff lint + format fixes in tests, ESLint fixes in frontend

This commit is contained in:
2026-07-17 21:28:58 +02:00
parent 341d0c6f38
commit fbb1b39b57
56 changed files with 1399 additions and 721 deletions
+6 -2
View File
@@ -71,13 +71,17 @@ def generate_thumbnail(
background = Image.new("RGB", img.size, (255, 255, 255))
if img.mode == "P":
img = img.convert("RGBA")
background.paste(img, mask=img.split()[-1] if img.mode in ("RGBA", "LA") else None)
background.paste(
img, mask=img.split()[-1] if img.mode in ("RGBA", "LA") else None
)
img = background
elif img.mode != "RGB":
img = img.convert("RGB")
# Use ImageOps.fit for a centered crop to exact thumbnail size
thumbnail = ImageOps.fit(img, THUMBNAIL_SIZE, method=Image.Resampling.LANCZOS)
thumbnail = ImageOps.fit(
img, THUMBNAIL_SIZE, method=Image.Resampling.LANCZOS
)
thumbnail.save(thumbnail_path, quality=85, optimize=True)
logger.info("Thumbnail generated: %s", thumbnail_path)