Exif rotation, description update
This commit is contained in:
@@ -5,7 +5,7 @@ import io
|
||||
import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from PIL import Image
|
||||
from PIL import Image, ImageOps
|
||||
from tools.utils import format_relative_time, ToolError, get_file_info_list, sort_file_list
|
||||
|
||||
logger = logging.getLogger("MattCP")
|
||||
@@ -115,6 +115,8 @@ async def handle(args: Dict[str, Any]):
|
||||
try:
|
||||
stats = file_path.stat()
|
||||
with Image.open(file_path) as img:
|
||||
# Apply EXIF orientation to fix sideways images
|
||||
img = ImageOps.exif_transpose(img)
|
||||
orig_w, orig_h = img.size
|
||||
target_w, target_h = calculate_patch_dimensions(orig_w, orig_h)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user