Pillow Plugin
HeifImageFile object
- class pillow_heif.as_plugin._LibHeifImageFile(*args, **kwargs)[source]
Bases:
ImageFileBase class with all functionality for
HeifImageFileclass.- info: dict
A dictionary holding data associated with the image.
Note
Known to this plugin keys and values in dictionary will be saved to the image. They are the same as in
HeifImageclass.- Specific keys for this plugin that is always present are:
exif, metadata, primary, bit_depth, thumbnails, depth_images, aux, original_orientation
- Optional there can be also such keys:
xmp, chroma, icc_profile, icc_profile_type, nclx_profile, content_light_level, mastering_display_colour_volume, ambient_viewing_environment, nominal_diffuse_white_luminance, pixel_aspect_ratio, tiling, heif, entity_groups
- info["original_orientation"]: int
Orientation that the
EXIF/XMPtags had in the file, orNonewhen there was none. The plugin callsset_orientation()for every image, so the tags themselves are already reset when the image is opened, see Workarounds.
- get_format_mimetype()
Returns the same as
get_file_mimetype()
- close() None[source]
Closes the file pointer, if possible.
This operation will destroy the image core and release its memory. The image data will be unusable afterward.
This function is required to close images that have multiple frames or have not had their file read and closed by the
load()method. See File handling in Pillow for more information.
- draft(mode: str | None, size: tuple[int, int] | None) tuple[str, tuple[int, int, float, float]] | None[source]
Configures the loader to decode an embedded thumbnail instead of the image.
The smallest thumbnail that is not smaller than
sizeand is a scaled copy of the image (same mode, aspect ratio, crop, rotation and mirroring, no other color profile) is selected,modeis ignored.thumbnail()calls this withsizemultiplied by itsreducing_gap.- Returns:
(mode, box)when a thumbnail was selected,Noneotherwise.
- seek(frame: int)[source]
Seeks to the given frame in this sequence file. If you seek beyond the end of the sequence, the method raises an
EOFErrorexception. When a sequence file is opened, the library automatically seeks to frame 0.See
tell().If defined,
n_framesrefers to the number of available frames.- Parameters:
frame – Frame number, starting at 0.
- Raises:
EOFError – If the call attempts to seek beyond the end of the sequence.
- class pillow_heif.HeifImageFile(*args, **kwargs)[source]
Bases:
_LibHeifImageFilePillow plugin class type for a HEIF image format.