GExiv2.PreviewImage

g GExiv2.PreviewImage GExiv2.PreviewImage GObject.Object GObject.Object GObject.Object->GExiv2.PreviewImage

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_data ()

get_extension ()

get_height ()

get_mime_type ()

get_width ()

try_write_file (path)

write_file (path)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GExiv2.PreviewImage(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GExiv2.PreviewImageClass

An accessor to the preview images contained in the image’s metadata.

This could be anything from a thumbnail to a full-sized camera development of a RAW image.

The GExiv2PreviewImage is obtained by calling GExiv2.Metadata.get_preview_image() with an instance of GExiv2.PreviewProperties that are describing the image to be fetched.

```c GExiv2.PreviewProperties **properties, **it; properties = it = GExiv2.Metadata.get_preview_properties(metadata);

while (*it) { preview_image = GExiv2.Metadata.get_preview_image(metadata, *it); it++; } ```

get_data()[source]
Returns:

The raw image data

Return type:

bytes

Get a pointer to the image data of the preview image. The returned data is owned by the preview image and must not be freed.

get_extension()[source]
Returns:

The preview image’s recommended file extension.

Return type:

str

Get the file extension commonly associated with the preview image

get_height()[source]
Returns:

The preview image’s display height in pixels.

Return type:

int

Get the height in pixels

get_mime_type()[source]
Returns:

The preview image’s MIME type.

Return type:

str

Get the MIME type associated with the preview image.

get_width()[source]
Returns:

The preview image’s display width in pixels.

Return type:

int

Get the width in pixels

try_write_file(path)[source]
Parameters:

path (str) – The file path to write the preview image to.

Raises:

GLib.Error

Returns:

The number of bytes written to the file.

Return type:

int

Write the preview image to a file in path

New in version 0.14.0.

Deprecated since version 0.16.0: Use [method`GExiv2`.PreviewImage.write_file] instead.

write_file(path)[source]
Parameters:

path (str) – The file path to write the preview image to.

Raises:

GLib.Error

Returns:

The number of bytes written to the file.

Return type:

int

Write the preview image to a file in path

New in version 0.16.0.