mirror of
https://github.com/enpaul/kodak.git
synced 2024-11-14 10:36:55 +00:00
Fix jpeg image autorotation issue
See also https://github.com/python-pillow/Pillow/issues/4703 See also https://github.com/huggingface/transformers/pull/14062
This commit is contained in:
parent
0bf2aba0ba
commit
55661034a4
@ -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
|
||||
@ -48,7 +49,8 @@ class ManipRecord(KodakModel):
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user