Gly.Image

g GObject.Object GObject.Object Gly.Image Gly.Image GObject.Object->Gly.Image

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_height ()

get_metadata_key_value (key)

get_metadata_keys ()

get_mime_type ()

get_specific_frame (frame_request)

get_specific_frame_async (frame_request, cancellable, callback, *user_data)

get_specific_frame_finish (result)

get_transformation_orientation ()

get_width ()

next_frame ()

next_frame_async (cancellable, callback, *user_data)

next_frame_finish (result)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gly.Image(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gly.ImageClass

Image handle containing metadata and allowing frame requests.

New in version 2.0.

get_height()
Returns:

height

Return type:

int

See [method`Image`.get_width]

New in version 2.0.

get_metadata_key_value(key)
Parameters:

key (str) – A null-terminated string.

Returns:

The UTF-8 encoded value associated with key.

Return type:

str or None

Get metadata that are stored as key-value pairs. A prominent example are PNG’s tEXt and zTXt chunks.

::: note In contrast to gdk-pixbuf’s *option* feature, the keys do not carry prefixes like tEXt:: or zTXt::.

New in version 2.0.

get_metadata_keys()
Returns:

List of existing keys.

Return type:

[str]

Get the list of available keys for [method`Image`.get_metadata_key_value].

New in version 2.0.

get_mime_type()
Returns:

MIME type

Return type:

str

Returns detected MIME type of the file

New in version 2.0.

get_specific_frame(frame_request)
Parameters:

frame_request (Gly.FrameRequest) –

Raises:

GLib.Error

Returns:

Loaded frame.

Return type:

Gly.Frame

New in version 2.0.

get_specific_frame_async(frame_request, cancellable, callback, *user_data)
Parameters:

Asynchronous version of [method`Image`.get_specific_frame].

New in version 2.0.

get_specific_frame_finish(result)
Parameters:

result (Gio.AsyncResult) – a GAsyncResult

Raises:

GLib.Error

Returns:

Loaded frame.

Return type:

Gly.Frame

Finishes the [method`Image`.get_specific_frame_async] call.

New in version 2.0.

get_transformation_orientation()
Return type:

int

Get the image orientation

The image orientation is given in Exif format. The function is guaranteed to only return values from 1 to 8.

If [method`Loader`.set_apply_transformations] is set to FALSE, the orientation has to be corrected manually to dispaly the image correctly.

New in version 2.0.

get_width()
Returns:

Width

Return type:

int

Early width information.

This information is often correct. However, it should only be used for an early rendering estimates. For everything else, the specific frame information should be used. See [method`Frame`.get_width].

New in version 2.0.

next_frame()
Raises:

GLib.Error

Returns:

a new [class`Frame`] on success, or NULL with error filled in

Return type:

Gly.Frame

Synchronously loads texture and information of the next frame.

For single still images, this can only be called once. For animated images, this function will loop to the first frame, when the last frame is reached.

New in version 2.0.

next_frame_async(cancellable, callback, *user_data)
Parameters:

Asynchronous version of [method`Image`.next_frame].

New in version 2.0.

next_frame_finish(result)
Parameters:

result (Gio.AsyncResult) – a GAsyncResult

Raises:

GLib.Error

Returns:

Loaded frame.

Return type:

Gly.Frame

Finishes the [method`Image`.next_frame_async] call.

New in version 2.0.