AppStreamGlib.Image

g AppStreamGlib.Image AppStreamGlib.Image GObject.Object GObject.Object GObject.Object->AppStreamGlib.Image

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

kind_from_string (kind)

class

kind_to_string (kind)

class

new ()

equal (image2)

get_basename ()

get_height ()

get_kind ()

get_locale ()

get_md5 ()

get_pixbuf ()

get_url ()

get_width ()

load_filename (filename)

load_filename_full (filename, dest_size, src_size_min, flags)

save_filename (filename, width, height, flags)

save_pixbuf (width, height, flags)

set_basename (basename)

set_height (height)

set_kind (kind)

set_locale (locale)

set_pixbuf (pixbuf)

set_url (url)

set_width (width)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStreamGlib.Image(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.ImageClass

classmethod kind_from_string(kind)[source]
Parameters:

kind (str) – the string.

Returns:

a AppStreamGlib.ImageKind, or AppStreamGlib.ImageKind.UNKNOWN for unknown.

Return type:

AppStreamGlib.ImageKind

Converts the text representation to an enumerated value.

New in version 0.1.0.

classmethod kind_to_string(kind)[source]
Parameters:

kind (AppStreamGlib.ImageKind) – the AppStreamGlib.ImageKind.

Returns:

string version of kind

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.1.0.

classmethod new()[source]
Returns:

a AppStreamGlib.Image

Return type:

AppStreamGlib.Image

Creates a new AppStreamGlib.Image.

New in version 0.1.0.

equal(image2)[source]
Parameters:

image2 (AppStreamGlib.Image) – a AppStreamGlib.Image instance.

Returns:

True for success

Return type:

bool

Checks if two images are the same.

New in version 0.5.7.

get_basename()[source]
Returns:

filename

Return type:

str

Gets the suggested basename the image, including file extension.

New in version 0.1.6.

get_height()[source]
Returns:

height in pixels

Return type:

int

Gets the image height.

New in version 0.1.0.

get_kind()[source]
Returns:

the AppStreamGlib.ImageKind

Return type:

AppStreamGlib.ImageKind

Gets the image kind.

New in version 0.1.0.

get_locale()[source]
Returns:

locale, or None

Return type:

str

Gets the locale of the image.

New in version 0.5.14.

get_md5()[source]
Returns:

string representing the MD5 sum, or None if unset

Return type:

str

Gets the string representation of the pixbuf hash value.

New in version 0.1.6.

get_pixbuf()[source]
Returns:

the GdkPixbuf.Pixbuf, or None

Return type:

GdkPixbuf.Pixbuf

Gets the image pixbuf if set.

New in version 0.1.6.

get_url()[source]
Returns:

URL

Return type:

str

Gets the full qualified URL for the image, usually pointing at some mirror.

New in version 0.1.0.

get_width()[source]
Returns:

width in pixels

Return type:

int

Gets the image width.

New in version 0.1.0.

load_filename(filename)[source]
Parameters:

filename (str) – filename to read from

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Reads a pixbuf from a file.

NOTE: This function also sets the suggested filename which can be retrieved using AppStreamGlib.Image.get_basename(). This can be overridden if required.

New in version 0.1.6.

load_filename_full(filename, dest_size, src_size_min, flags)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Reads an image from a file.

New in version 0.5.6.

save_filename(filename, width, height, flags)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Saves a pixbuf to a file.

New in version 0.1.6.

save_pixbuf(width, height, flags)[source]
Parameters:
Returns:

A GdkPixbuf.Pixbuf of the specified size

Return type:

GdkPixbuf.Pixbuf

Resamples a pixbuf to a specific size.

New in version 0.1.6.

set_basename(basename)[source]
Parameters:

basename (str) – the new filename basename.

Sets the image basename filename.

New in version 0.1.6.

set_height(height)[source]
Parameters:

height (int) – the height in pixels.

Sets the image height.

New in version 0.1.0.

set_kind(kind)[source]
Parameters:

kind (AppStreamGlib.ImageKind) – the AppStreamGlib.ImageKind, e.g. AppStreamGlib.ImageKind.THUMBNAIL.

Sets the image kind.

New in version 0.1.0.

set_locale(locale)[source]
Parameters:

locale (str) – the new image locale, e.g. “en_GB” or None.

Sets the image locale.

New in version 0.5.14.

set_pixbuf(pixbuf)[source]
Parameters:

pixbuf (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf, or None

Sets the image pixbuf.

New in version 0.1.6.

set_url(url)[source]
Parameters:

url (str) – the URL.

Sets the fully-qualified mirror URL to use for the image.

New in version 0.1.0.

set_width(width)[source]
Parameters:

width (int) – the width in pixels.

Sets the image width.

New in version 0.1.0.