Preserve alpha channel during resize

This commit is contained in:
Zeva Rose 2021-06-26 20:36:59 -06:00
parent a3551dd02b
commit 8e7ebc940f

View file

@ -59,7 +59,7 @@ class ImageCog(commands.Cog):
ratio = size / tgt_size
buffer = np.frombuffer(file, dtype=np.uint8)
img = cv2.imdecode(buffer, flags=1)
img = cv2.imdecode(buffer, flags=-1)
width = int(img.shape[1] * ratio)
height = int(img.shape[0] * ratio)