Skip to main content

ImageFile

A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images.

Attributes

AttributeTypeDescription
widthintegerThe horizontal pixel dimension of the image retrieved from the image file's metadata.
heightintegerThe vertical pixel dimension of the image retrieved from the image file's metadata.

Constructor

Signature

def ImageFile()

Methods


width()

@classmethod
def width() - > int

Retrieves the horizontal dimension of the image in pixels.

Returns

TypeDescription
intThe width of the image in pixels.

height()

@classmethod
def height() - > int

Retrieves the vertical dimension of the image in pixels.

Returns

TypeDescription
intThe height of the image in pixels.