From 67389466368f00f56c4b5266f7a59fa757a12ebd Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Fri, 15 Aug 2025 10:38:08 -0600 Subject: [PATCH] Remove image rotation (no longer needed with modern PIL?) --- cista/preview.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/cista/preview.py b/cista/preview.py index 2c9a2fb..5d09332 100644 --- a/cista/preview.py +++ b/cista/preview.py @@ -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()