Skip to main content

Module image

Module image 

Source
Expand description

The validation and the conversion of images.

Structs§

Converted
The image that the model sees, and the size of the upright original.
Header
The size of an image, in pixels.

Enums§

ConvertError
An image that the conversion cannot take.
HeaderError
An image that the API cannot take as it is.

Constants§

PNG_SIGNATURE
The first eight bytes of each PNG file.

Functions§

convert
Converts an image into the limits of the API.
decode
Decodes an image, with its pixels upright by its EXIF orientation.
encode
Scales an image into the limits of the API, and encodes it.
fitted_size
Returns the size that fits the limits of the API, with the same aspect ratio.
read_header
Reads the size of a PNG or JPEG image, and validates the image.