I found out how to use PIL to get the image dimensions, but not the file size in bytes. I need to know the file size to decide if the file is too big to be uploaded to the d
To find the Size(In bytes) of an image using Pillow Library, please use the below code. It will working fine.
from PIL import Image image_file = Image.open(filename) print("File Size In Bytes:- "+str(len(image_file.fp.read()))
Make sure that you have pillow library installed:-
pip install pillow