How to find height and width of image if our model is defined as follow
class MModel:
document = FileField()
format_type = CharField()
and image is saved in document then how we can find height and width of a document if it is image ?
How to find height and width of image if our model is defined as follow
class MModel:
document = FileField()
format_type = CharField()
and image is saved in document then how we can find height and width of a document if it is image ?
If the files will always be images, change
FileField
toImageField
, like this:Otherwise, you'll have to manually calculate the image width and height: