Gegl.MetadataStore

g GObject.GInterface GObject.GInterface Gegl.Metadata Gegl.Metadata GObject.GInterface->Gegl.Metadata GObject.Object GObject.Object Gegl.MetadataStore Gegl.MetadataStore GObject.Object->Gegl.MetadataStore Gegl.Metadata->Gegl.MetadataStore

Subclasses:

Gegl.MetadataHash

Methods

Inherited:

GObject.Object (37), Gegl.Metadata (9)

Structs:

GObject.ObjectClass (5)

declare (pspec)

get_artist ()

get_comment ()

get_copyright ()

get_description ()

get_disclaimer ()

get_file_module_name ()

get_resolution_unit ()

get_resolution_x ()

get_resolution_y ()

get_software ()

get_source ()

get_string (name)

get_timestamp ()

get_title ()

get_value (name, value)

get_warning ()

has_value (name)

notify (pspec, shadow)

register (local_name, name, transform)

set_artist (artist)

set_comment (comment)

set_copyright (copyright)

set_description (description)

set_disclaimer (disclaimer)

set_resolution_unit (unit)

set_resolution_x (resolution_x)

set_resolution_y (resolution_y)

set_software (software)

set_source (source)

set_string (name, string)

set_timestamp (timestamp)

set_title (title)

set_value (name, value)

set_warning (warning)

typeof_value (name)

Virtual Methods

Inherited:

GObject.Object (7), Gegl.Metadata (8)

do__declare (pspec, shadow)

do__get_value (name)

do_has_value (name)

do_register_hook (file_module_name, flags)

do_set_value (name, value)

Properties

Name

Type

Flags

Short Description

artist

str

r/w/en

Name of image creator

comment

str

r/w/en

Miscellaneous comment

copyright

str

r/w/en

Copyright notice

description

str

r/w/en

Description of image (possibly long)

disclaimer

str

r/w/en

Legal disclaimer

file-module-name

str

r/en

Name of currently active file module or None

resolution-unit

Gegl.ResolutionUnit

r/w/en

Units for image resolution

resolution-x

float

r/w/en

X Resolution

resolution-y

float

r/w/en

X Resolution

software

str

r/w/en

Software used to create the image

source

str

r/w/en

Device used to create the image

timestamp

GLib.DateTime

r/w/en

Image creation time

title

str

r/w/en

Short title or caption

warning

str

r/w/en

Warning of nature of content

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

::changed is emitted when a metadata value is changed.

generate-value

If a signal handler is connected to ::generate-value a signal is emitted when the file module accesses a value using gegl_metadata_get_value().

mapped

::mapped is emitted after a file module registers a mapping and before other processing takes place.

parse-value

If a signal handler is connected to ::parse-value a signal is emitted when the file module accesses a value using gegl_metadata_set_value().

unmapped

::unmapped is emitted when a file module tries to look up an unmapped metadata name.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gegl.MetadataStore(**kwargs)
Bases:

GObject.Object, Gegl.Metadata

Abstract:

Yes

Structure:

Gegl.MetadataStoreClass

declare(pspec)
Parameters:

pspec (GObject.ParamSpec) – A GObject.ParamSpec

Declare a metadata value using a GObject.ParamSpec.

get_artist()
Returns:

Artist or None if not set

Return type:

str

Get name of image creator.

get_comment()
Returns:

Comment or None if not set

Return type:

str

Get the comment.

Returns:

Copyright or None if not set

Return type:

str

Get the copyright notice.

get_description()
Returns:

Description or None if not set

Return type:

str

Get description of image.

get_disclaimer()
Returns:

Disclaimer or None if not set

Return type:

str

Get the legal disclaimer.

get_file_module_name()
Returns:

Current file module name or None.

Return type:

str

Return the name registered by the current file module.

get_resolution_unit()
Returns:

a Gegl.ResolutionUnit.

Return type:

Gegl.ResolutionUnit

Get the units used for resolution.

get_resolution_x()
Returns:

X resolution

Return type:

float

Get the X resolution or density in dots per unit.

get_resolution_y()
Returns:

Y resolution

Return type:

float

Get the Y resolution or density in dots per unit.

get_software()
Returns:

Software or None if not set

Return type:

str

Get software used to create the image.

get_source()
Returns:

source or None if not set

Return type:

str

Get device used to create the image.

get_string(name)
Parameters:

name (str) – Metadata name

Returns:

String or None.

Return type:

str

A slightly more efficient version of Gegl.MetadataStore.get_value() for string values avoiding a duplication. Otherwise it behaves the same Gegl.MetadataStore.get_value().

get_timestamp()
Returns:

GLib.DateTime or None if not set. Free with GLib.DateTime.unref() when done.

Return type:

GLib.DateTime

Get time of original image creation.

get_title()
Returns:

Title or None if not set

Return type:

str

Get title or caption for image.

get_value(name, value)
Parameters:
Returns:

An initialised GObject.Value.

Return type:

value: GObject.Value

Retrieve the metadata value. value must be initialised with a compatible type. If the value is unset or has not been previously declared value is unchanged and an error message is logged.

get_warning()
Returns:

Warning or None if not set

Return type:

str

Get warning.

has_value(name)
Parameters:

name (str) – Metadata name

Returns:

True if metadata is declared and contains a valid value.

Return type:

bool

Test whether the Gegl.MetadataStore contains a value for the specified name.

notify(pspec, shadow)
Parameters:

Gegl.MetadataStore.notify() is called by subclasses when the value of a metadata variable changes. It emits the ::changed signal with the variable name as the detail parameter. Set shadow = True if variable is shadowed by a property so that a notify signal is emitted with the property name as the detail parameter.

register(local_name, name, transform)
Parameters:
set_artist(artist)
Parameters:

artist (str) – Artist string

Set name of image creator.

set_comment(comment)
Parameters:

comment (str) – Comment string

Set the miscellaneous comment; conversion from GIF comment.

Parameters:

copyright (str) – Copyright string

Set the copyright notice.

set_description(description)
Parameters:

description (str) – Description string

Set description of image.

set_disclaimer(disclaimer)
Parameters:

disclaimer (str) – Disclaimer string

Set the legal disclaimer.

set_resolution_unit(unit)
Parameters:

unit (Gegl.ResolutionUnit) – Units as a Gegl.ResolutionUnit

Set the units used for the resolution (density) values.

set_resolution_x(resolution_x)
Parameters:

resolution_x (float) – X resolution or density

Set the X resolution or density in dots per unit.

set_resolution_y(resolution_y)
Parameters:

resolution_y (float) – Y resolution or density

Set the Y resolution or density in dots per unit.

set_software(software)
Parameters:

software (str) – Software string

Set software used to create the image.

set_source(source)
Parameters:

source (str) – Source string

Set device used to create the image.

set_string(name, string)
Parameters:
  • name (str) – Metadata name

  • string (str) – String value to set

A slightly more efficient version of Gegl.MetadataStore.set_value() for string values avoiding a duplication. Otherwise it behaves the same Gegl.MetadataStore.set_value().

set_timestamp(timestamp)
Parameters:

timestamp (GLib.DateTime) – A GLib.DateTime

Set time of original image creation.

set_title(title)
Parameters:

title (str) – Title string

Set title or caption for image.

set_value(name, value)
Parameters:

Set the specified metadata value. If value is None the default value from the associated GObject.ParamSpec is used. This operation will fail if the value has not been previously declared. A changed::name signal is emitted when the value is set. If the value is shadowed by a property a notify::name signal is also emitted.

set_warning(warning)
Parameters:

warning (str) – Warning string

Set the warning of nature of content.

typeof_value(name)
Parameters:

name (str) – Metadata name

Returns:

Declared GObject.GType of metadata value or GObject.TYPE_INVALID.

Return type:

GObject.GType

Get the declared type of the value in the Gegl.MetadataStore.

do__declare(pspec, shadow) virtual
Parameters:
do__get_value(name) virtual
Parameters:

name (str) –

Return type:

GObject.Value

do_has_value(name) virtual
Parameters:

name (str) – Metadata name

Returns:

True if metadata is declared and contains a valid value.

Return type:

bool

Test whether the Gegl.MetadataStore contains a value for the specified name.

do_register_hook(file_module_name, flags) virtual
Parameters:
  • file_module_name (str) –

  • flags (int) –

do_set_value(name, value) virtual
Parameters:

Set the specified metadata value. If value is None the default value from the associated GObject.ParamSpec is used. This operation will fail if the value has not been previously declared. A changed::name signal is emitted when the value is set. If the value is shadowed by a property a notify::name signal is also emitted.

Signal Details

Gegl.MetadataStore.signals.changed(metadata_store, pspec)
Signal Name:

changed

Flags:

RUN_LAST, DETAILED

Parameters:

::changed is emitted when a metadata value is changed. This is analogous to the GObject::notify signal.

Gegl.MetadataStore.signals.generate_value(metadata_store, pspec, value)
Signal Name:

generate-value

Flags:

RUN_LAST, DETAILED

Parameters:
Returns:

True if a value is generated successfully.

value:

An initialised GObject.Value.

Return type:

(bool, value: GObject.Value)

If a signal handler is connected to ::generate-value a signal is emitted when the file module accesses a value using gegl_metadata_get_value(). The signal handler must generate a value of the type specified in the pspec argument. The signal handler’s return value indicates the success of the operation.

If no handler is connected the mapped metadata value is accessed normally,

Gegl.MetadataStore.signals.mapped(metadata_store, file_module, exclude_unmapped)
Signal Name:

mapped

Flags:

RUN_LAST

Parameters:
  • metadata_store (Gegl.MetadataStore) – The object which received the signal

  • file_module (str) – The file module name

  • exclude_unmapped (bool) – True if the file module cannot handle unmapped values

::mapped is emitted after a file module registers a mapping and before other processing takes place. An application may respond to the signal by registering additional mappings or overriding existing values, for example it might override the TIFF ImageDescription tag to format multiple metadata values into the description.

Gegl.MetadataStore.signals.parse_value(metadata_store, pspec, value)
Signal Name:

parse-value

Flags:

RUN_LAST, DETAILED

Parameters:
Returns:

True if parsing is successful.

value:

A GObject.Value containing the value to parse.

Return type:

(bool, value: GObject.Value)

If a signal handler is connected to ::parse-value a signal is emitted when the file module accesses a value using gegl_metadata_set_value(). The signal handler should parse the value supplied in the GObject.Value and may set any number of metadata values using Gegl.MetadataStore.set_value().

If no handler is connected the mapped metadata value is set normally,

Gegl.MetadataStore.signals.unmapped(metadata_store, file_module, local_name)
Signal Name:

unmapped

Flags:

RUN_LAST

Parameters:
  • metadata_store (Gegl.MetadataStore) – The object which received the signal

  • file_module (str) – The file module name

  • local_name (str) – The unmapped metadata name as used by the file module

::unmapped is emitted when a file module tries to look up an unmapped metadata name. When the handler returns a second attempt is made to look up the metadata.

Property Details

Gegl.MetadataStore.props.artist
Name:

artist

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Name of image creator.

Gegl.MetadataStore.props.comment
Name:

comment

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Miscellaneous comment; conversion from GIF comment.

Gegl.MetadataStore.props.copyright
Name:

copyright

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Copyright notice.

Gegl.MetadataStore.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Description of image (possibly long).

Gegl.MetadataStore.props.disclaimer
Name:

disclaimer

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Legal disclaimer.

Gegl.MetadataStore.props.file_module_name
Name:

file-module-name

Type:

str

Default Value:

None

Flags:

READABLE, EXPLICIT_NOTIFY

Current file loader/saver module name. Valid only while a Gegl.Metadata mapping is registered. This property is mainly provided for use in signal handlers.

Gegl.MetadataStore.props.resolution_unit
Name:

resolution-unit

Type:

Gegl.ResolutionUnit

Default Value:

Gegl.ResolutionUnit.DPI

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A Gegl.ResolutionUnit specifying units for the image resolution (density).

Gegl.MetadataStore.props.resolution_x
Name:

resolution-x

Type:

float

Default Value:

300.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

X resolution or density in dots per unit.

Gegl.MetadataStore.props.resolution_y
Name:

resolution-y

Type:

float

Default Value:

300.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Y resolution or density in dots per unit.

Gegl.MetadataStore.props.software
Name:

software

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Software used to create the image.

Gegl.MetadataStore.props.source
Name:

source

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Device used to create the image.

Gegl.MetadataStore.props.timestamp
Name:

timestamp

Type:

GLib.DateTime

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Time of original image creation.

Gegl.MetadataStore.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Short (one line) title or caption for image.

Gegl.MetadataStore.props.warning
Name:

warning

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Warning of nature of content.