Skip to content

Commit 14fc0ac

Browse files
committed
only show rotation message if image has actually been rotated
1 parent d61bc43 commit 14fc0ac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bma_client_lib/bma_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,11 @@ def upload_file(self, path: Path, attribution: str, file_license: str) -> dict[s
390390
rotated = ImageOps.exif_transpose(image) # creates a copy with rotation normalised
391391
if rotated is None:
392392
raise ValueError("Rotation")
393-
logger.debug(
394-
f"Image has exif rotation info, using post-rotate size {rotated.size} "
395-
f"instead of raw size {image.size}"
396-
)
393+
if rotated.size != image.size:
394+
logger.debug(
395+
f"Image has exif rotation info, using post-rotate size {rotated.size} "
396+
f"instead of raw size {image.size}"
397+
)
397398
width, height = rotated.size
398399

399400
# open file

0 commit comments

Comments
 (0)