I am using the pillow library. I have an image whose dimension is 1280x1920. When I upload the image, I want to resize the image to 800x600. But after uploading, the image resized to 475x350. Is there any way to forcibly resize the image into the given dimension? This is my code to resize the image in Django:
img = Image.open(self.image.path)
if img.width > 800 or img.height > 600:
img.resize((800, 600), Image.ANTIALIAS)
img.save(self.image.path)