+# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
+#
 import io
 import time
 from urllib.request import urlopen
 import PIL.Image
+from PIL import ImageOps
 from .base import Widget
 
 
                     break
                 
             img = PIL.Image.open(data)
+            img = ImageOps.exif_transpose(img)
 
             if self.crop_to_square:
                 # crop top square.