Skip to content

Commit

Permalink
Merge pull request #7945 from w-e-w/fix-image-downscale
Browse files Browse the repository at this point in the history
Fix broken image downscale TypeError
  • Loading branch information
AUTOMATIC1111 committed Feb 20, 2023
2 parents 65995a2 + f71a3c9 commit 0cc0ee1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ def _atomically_save_image(image_to_save, filename_without_extension, extension)
ratio = image.width / image.height

if oversize and ratio > 1:
image = image.resize((opts.target_side_length, image.height * opts.target_side_length // image.width), LANCZOS)
image = image.resize((round(opts.target_side_length), round(image.height * opts.target_side_length / image.width)), LANCZOS)
elif oversize:
image = image.resize((image.width * opts.target_side_length // image.height, opts.target_side_length), LANCZOS)
image = image.resize((round(image.width * opts.target_side_length / image.height), round(opts.target_side_length)), LANCZOS)

try:
_atomically_save_image(image, fullfn_without_extension, ".jpg")
Expand Down

2 comments on commit 0cc0ee1

@ystar2013
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty girl

@razanaqi98
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sir how do i download it?

Please sign in to comment.