mirror of
https://github.com/enpaul/kodak.git
synced 2024-11-14 18:46:50 +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 logging
|
||||||
|
|
||||||
import peewee
|
import peewee
|
||||||
from PIL import Image
|
import PIL.Image
|
||||||
|
import PIL.ImageOps
|
||||||
|
|
||||||
from kodak import configuration
|
from kodak import configuration
|
||||||
from kodak import constants
|
from kodak import constants
|
||||||
@ -48,7 +49,8 @@ class ManipRecord(KodakModel):
|
|||||||
config.content_dir / parent.name / f"{manip.name}.{format_.name.lower()}"
|
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:
|
if manip.scale.horizontal is not None or manip.scale.vertical is not None:
|
||||||
image = manipulations.scale(image, manip)
|
image = manipulations.scale(image, manip)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user