Skip to content

Commit

Permalink
Fix image uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
HSZemi committed Oct 6, 2023
1 parent 03ab1c9 commit 3f2c961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mapsapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def save(self):
new_height = math.floor(factor * uploaded_image.height)

# Resize/modify the image
resized_image = uploaded_image.resize((new_width, new_height), resample=PilImage.LINEAR)
resized_image = uploaded_image.resize((new_width, new_height), resample=PilImage.BILINEAR)

# after modifications, save it to the output
resized_image.save(output, format='PNG', quality=100)
Expand All @@ -130,7 +130,7 @@ def save(self):
preview_width = math.floor(preview_factor * uploaded_image.width)
preview_height = math.floor(preview_factor * uploaded_image.height)

uncropped_preview = uploaded_image.resize((preview_width, preview_height), resample=PilImage.LINEAR)
uncropped_preview = uploaded_image.resize((preview_width, preview_height), resample=PilImage.BILINEAR)
crop_left = math.floor((preview_width - PREVIEW_WIDTH) / 2)
crop_upper = math.floor((preview_height - PREVIEW_HEIGHT) / 2)
crop_right = crop_left + PREVIEW_WIDTH
Expand Down

0 comments on commit 3f2c961

Please sign in to comment.