Update the project to run with modern uv/bun (or python/nodejs) environment #7

Merged
LeoVasanko merged 43 commits from rejuvenile into main 2025-08-15 18:03:04 +01:00
Showing only changes of commit 6738946636 - Show all commits

View File

@ -74,21 +74,11 @@ def process_image(path, *, maxsize, quality):
# Force decode to include I/O in load timing
img.load()
t_load_end = perf_counter()
# Resize and orientation fix (processing)
# Resize
orig_w, orig_h = img.size
t_proc_start = perf_counter()
img.thumbnail((min(orig_w, maxsize), min(orig_h, maxsize)))
try:
rotate_values = {3: 180, 6: 270, 8: 90}
orientation = img.getexif().get(274)
if orientation in rotate_values:
logger.debug(f"Rotating preview {path} by {rotate_values[orientation]}")
img = img.rotate(rotate_values[orientation], expand=True)
except Exception as e:
logger.error(f"Error rotating preview image: {e}")
t_proc_end = perf_counter()
# Save as AVIF
imgdata = io.BytesIO()
t_save_start = perf_counter()