I have ImageField
in my model and I\'m able to display the image in a template. However, how do I retrieve the image\'s height and width?
In my case, for the width
and height
fields to work, I need to set the width_field and height_field of the ImageField
E.g.
class Product(models.Model):
image = models.ImageField(width_field='image_width', height_field='image_height')
image_width = models.IntegerField()
image_height = models.IntegerField()