Remove image rotation (no longer needed with modern PIL?)
This commit is contained in:
parent
fff23617ba
commit
6738946636
@ -74,21 +74,11 @@ def process_image(path, *, maxsize, quality):
|
|||||||
# Force decode to include I/O in load timing
|
# Force decode to include I/O in load timing
|
||||||
img.load()
|
img.load()
|
||||||
t_load_end = perf_counter()
|
t_load_end = perf_counter()
|
||||||
|
# Resize
|
||||||
# Resize and orientation fix (processing)
|
|
||||||
orig_w, orig_h = img.size
|
orig_w, orig_h = img.size
|
||||||
t_proc_start = perf_counter()
|
t_proc_start = perf_counter()
|
||||||
img.thumbnail((min(orig_w, maxsize), min(orig_h, maxsize)))
|
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()
|
t_proc_end = perf_counter()
|
||||||
|
|
||||||
# Save as AVIF
|
# Save as AVIF
|
||||||
imgdata = io.BytesIO()
|
imgdata = io.BytesIO()
|
||||||
t_save_start = perf_counter()
|
t_save_start = perf_counter()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user