:right-sidebar: True Image =================================================================== .. currentmodule:: gi.repository.Gly .. versionadded:: 2.0 .. class:: Image(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Image handle containing metadata and allowing frame requests. Methods ------- .. rst-class:: interim-class .. class:: Image :no-index: .. method:: get_height() -> int See :obj:`~gi.repository.Image.get_width` .. versionadded:: 2.0 .. method:: get_metadata_key_value(key: str) -> str | 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::``\. .. versionadded:: 2.0 :param key: A null-terminated string. .. method:: get_metadata_keys() -> list[str] Get the list of available keys for :obj:`~gi.repository.Image.get_metadata_key_value`\. .. versionadded:: 2.0 .. method:: get_mime_type() -> str Returns detected MIME type of the file .. versionadded:: 2.0 .. method:: get_specific_frame(frame_request: ~gi.repository.Gly.FrameRequest) -> ~gi.repository.Gly.Frame .. versionadded:: 2.0 :param frame_request: .. method:: get_specific_frame_async(self, frame_request: ~gi.repository.Gly.FrameRequest) -> ~gi.repository.Gly.Frame :async: This is the `awaitable `_ version of :meth:`get_specific_frame_async`. .. versionadded:: 2.0 :param frame_request: .. method:: get_specific_frame_async(frame_request: ~gi.repository.Gly.FrameRequest, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~collections.abc.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronous version of :obj:`~gi.repository.Image.get_specific_frame`\. .. versionadded:: 2.0 :param frame_request: :param cancellable: A :obj:`~gi.repository.Gio.Cancellable` to cancel the operation :param callback: A callback to call when the operation is complete :param user_data: Data to pass to ``callback`` .. method:: get_specific_frame_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gly.Frame Finishes the :obj:`~gi.repository.Image.get_specific_frame_async` call. .. versionadded:: 2.0 :param result: a ``GAsyncResult`` .. method:: get_transformation_orientation() -> 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 :obj:`~gi.repository.Loader.set_apply_transformations` is set to ``FALSE``\, the orientation has to be corrected manually to display the image correctly. .. versionadded:: 2.0 .. method:: get_width() -> 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 :obj:`~gi.repository.Frame.get_width`\. .. versionadded:: 2.0 .. method:: next_frame() -> ~gi.repository.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. .. versionadded:: 2.0 .. method:: next_frame_async(self) -> ~gi.repository.Gly.Frame :async: This is the `awaitable `_ version of :meth:`next_frame_async`. .. versionadded:: 2.0 .. method:: next_frame_async(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~collections.abc.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronous version of :obj:`~gi.repository.Image.next_frame`\. .. versionadded:: 2.0 :param cancellable: A :obj:`~gi.repository.Gio.Cancellable` to cancel the operation :param callback: A callback to call when the operation is complete :param user_data: Data to pass to ``callback`` .. method:: next_frame_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gly.Frame Finishes the :obj:`~gi.repository.Image.next_frame_async` call. .. versionadded:: 2.0 :param result: a ``GAsyncResult``