diff --git a/sorl/thumbnail/engines/convert_engine.py b/sorl/thumbnail/engines/convert_engine.py index 320148885..2a9dbe6b4 100644 --- a/sorl/thumbnail/engines/convert_engine.py +++ b/sorl/thumbnail/engines/convert_engine.py @@ -110,7 +110,8 @@ def is_valid_image(self, raw_data): def _get_exif_orientation(self, image): args = settings.THUMBNAIL_IDENTIFY.split() - args.extend(['-format', '%[exif:orientation]', image['source']]) + image_param = f"{image['source']}[0]" + args.extend(["-format", "%[exif:orientation]", image_param]) p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.wait() result = p.stdout.read().strip()