Use imagetools.pad_to_square.

This commit is contained in:
voussoir 2021-08-09 08:46:08 -07:00
parent 4b2209d7ef
commit 5f201f99a1
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -127,6 +127,7 @@ def load_image(filename):
(new_w, new_h) = imagetools.fit_into_bounds(w, h, 256, 256, only_shrink=True) (new_w, new_h) = imagetools.fit_into_bounds(w, h, 256, 256, only_shrink=True)
image = image.resize((new_w, new_h), resample=PIL.Image.ANTIALIAS) image = image.resize((new_w, new_h), resample=PIL.Image.ANTIALIAS)
image = image.convert('RGBA') image = image.convert('RGBA')
image = imagetools.pad_to_square(image)
return image return image
def build_ico_header_blob(image_count): def build_ico_header_blob(image_count):