Skip to content

Commit

Permalink
keep image orientation pt. 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ihaveamicroservice committed Mar 8, 2024
1 parent 42e5d91 commit 3d46829
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ def compress(inputblob: func.InputStream, resolution: int) -> bytes:
image = Image.open(inputblob)

# Correct the orientation of the image according to its EXIF data
try:
ImageOps.exif_transpose(image, in_place=True)
except Exception as e:
print(f"Error transposing image: {e}")
# Handle the error appropriately or raise
ImageOps.exif_transpose(image, in_place=True)

# Set max height and width
max_size = (resolution, resolution)
Expand Down

0 comments on commit 3d46829

Please sign in to comment.