Skip to content

Commit

Permalink
Fix jpeg image autorotation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
enpaul committed Dec 31, 2021
1 parent 0bf2aba commit 5566103
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kodak/database/manip.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

import peewee
from PIL import Image
import PIL.Image
import PIL.ImageOps

from kodak import configuration
from kodak import constants
Expand Down Expand Up @@ -48,7 +49,8 @@ def from_parent(
config.content_dir / parent.name / f"{manip.name}.{format_.name.lower()}"
)

with Image.open(config.source_dir / parent.source) as image:
with PIL.Image.open(config.source_dir / parent.source) as image:
image = PIL.ImageOps.exif_transpose(image)
if manip.scale.horizontal is not None or manip.scale.vertical is not None:
image = manipulations.scale(image, manip)

Expand Down

0 comments on commit 5566103

Please sign in to comment.