PixbufFormat

Added in version 2.2.

class PixbufFormat(*args, **kwargs)

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.

Methods

class PixbufFormat
free() None

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

Added in version 2.22.

get_description() str

Returns a description of the format.

Added in version 2.2.

get_extensions() list[str]

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

Added in version 2.2.

get_license() str

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.

Added in version 2.6.

get_mime_types() list[str]

Returns the mime types supported by the format.

Added in version 2.2.

get_name() str

Returns the name of the format.

Added in version 2.2.

is_disabled() bool

Returns whether this image format is disabled.

See set_disabled().

Added in version 2.6.

is_save_option_supported(option_key: str) bool

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

See save() for more information about option keys.

Added in version 2.36.

Parameters:

option_key – the name of an option

is_scalable() 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.

Added in version 2.6.

is_writable() bool

Returns whether pixbufs can be saved in the given format.

Added in version 2.2.

set_disabled(disabled: bool) None

Disables or enables an image format.

If a format is disabled, GdkPixbuf 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 get_license().

Added in version 2.6.

Parameters:

disabledTRUE to disable the format format

Fields

class PixbufFormat
description

A description of the image format

disabled

A boolean determining whether the loader is disabled`

domain

The message domain for the description

extensions

Typical filename extensions for the image format

flags

A combination of GdkPixbufFormatFlags

license

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

mime_types

The MIME types for the image format

name

The name of the image format

signature

The signature of the module