GdkPixbuf.PixbufFormat

Fields

Name

Type

Access

Description

description

str

r/w

a description of the image format

disabled

bool

r/w

a boolean determining whether the loader is disabled`

domain

str

r/w

the message domain for the description

extensions

[str]

r/w

typical filename extensions for the image format

flags

int

r/w

a combination of GdkPixbufFormatFlags

license

str

r/w

a string containing license information, typically set to shorthands like “GPL”, “LGPL”, etc.

mime_types

[str]

r/w

the MIME types for the image format

name

str

r/w

the name of the image format

signature

GdkPixbuf.PixbufModulePattern

r/w

the signature of the module

Methods

copy ()

free ()

get_description ()

get_extensions ()

get_license ()

get_mime_types ()

get_name ()

is_disabled ()

is_save_option_supported (option_key)

is_scalable ()

is_writable ()

set_disabled (disabled)

Details

class GdkPixbuf.PixbufFormat

A GdkPixbufFormat contains information about the image format accepted by a module.

Only modules should access the fields directly, applications should use the gdk_pixbuf_format_* family of functions.

New in version 2.2.

copy()[source]
Returns:

the newly allocated copy of a GdkPixbufFormat. Use GdkPixbuf.PixbufFormat.free() to free the resources when done

Return type:

GdkPixbuf.PixbufFormat or None

Creates a copy of format.

New in version 2.22.

free()[source]

Frees the resources allocated when copying a GdkPixbufFormat using GdkPixbuf.PixbufFormat.copy()

New in version 2.22.

get_description()[source]
Returns:

a description of the format.

Return type:

str or None

Returns a description of the format.

New in version 2.2.

get_extensions()[source]
Returns:

an array of filename extensions

Return type:

[str] or None

Returns the filename extensions typically used for files in the given format.

New in version 2.2.

get_license()[source]
Returns:

a string describing the license of the pixbuf format

Return type:

str or None

Returns information about the license of the image loader for the format.

The returned string should be a shorthand for a well known license, e.g. “LGPL”, “GPL”, “QPL”, “GPL/QPL”, or “other” to indicate some other license.

New in version 2.6.

get_mime_types()[source]
Returns:

an array of mime types

Return type:

[str] or None

Returns the mime types supported by the format.

New in version 2.2.

get_name()[source]
Returns:

the name of the format.

Return type:

str or None

Returns the name of the format.

New in version 2.2.

is_disabled()[source]
Returns:

whether this image format is disabled.

Return type:

bool

Returns whether this image format is disabled.

See GdkPixbuf.PixbufFormat.set_disabled().

New in version 2.6.

is_save_option_supported(option_key)[source]
Parameters:

option_key (str) – the name of an option

Returns:

TRUE if the specified option is supported

Return type:

bool

Returns TRUE if the save option specified by option_key is supported when saving a pixbuf using the module implementing self.

See gdk_pixbuf_save() for more information about option keys.

New in version 2.36.

is_scalable()[source]
Returns:

whether this image format is scalable.

Return type:

bool

Returns whether this image format is scalable.

If a file is in a scalable format, it is preferable to load it at the desired size, rather than loading it at the default size and scaling the resulting pixbuf to the desired size.

New in version 2.6.

is_writable()[source]
Returns:

whether pixbufs can be saved in the given format.

Return type:

bool

Returns whether pixbufs can be saved in the given format.

New in version 2.2.

set_disabled(disabled)[source]
Parameters:

disabled (bool) – TRUE to disable the format self

Disables or enables an image format.

If a format is disabled, GdkPixbuf.Pixbuf won’t use the image loader for this format to load images.

Applications can use this to avoid using image loaders with an inappropriate license, see GdkPixbuf.PixbufFormat.get_license().

New in version 2.6.