Top |
Generic image metadata handlingGeneric image metadata handling — Class to handle the various image metadata standards |
enum | GExiv2Orientation |
enum | GExiv2StructureType |
struct | GExiv2Metadata |
enum | GExiv2ByteOrder |
GEnum ├── GExiv2ByteOrder ├── GExiv2Orientation ╰── GExiv2StructureType GObject ╰── GExiv2Metadata
GExiv2Metadata is a generic object that provides everything from simple aggregated accessors to common data such as image comments up to fine-grained access to specific tags of a specific format, be it EXIF, IPTC or XMP
void
gexiv2_metadata_free (GExiv2Metadata *self
);
gexiv2_metadata_free
has been deprecated since version 0.10.3 and should not be used in newly-written code.
Use g_object_unref()
instead.
Destroys the GExiv2Metadata object and frees all associated memory.
gboolean gexiv2_metadata_try_has_tag (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.14.0
gboolean gexiv2_metadata_try_clear_tag (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
Removes the Exiv2 tag from the metadata object.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.14.0
void
gexiv2_metadata_clear (GExiv2Metadata *self
);
Removes all tags for all domains (EXIF, IPTC, and XMP).
const gchar * gexiv2_metadata_try_get_tag_label (const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Since: 0.12.2
const gchar * gexiv2_metadata_try_get_tag_description (const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Since: 0.12.2
const gchar * gexiv2_metadata_try_get_tag_type (const gchar *tag
,GError **error
);
The names of the various Exiv2 tag types can be found at Exiv2::TypeId,
http://exiv2.org/doc/namespaceExiv2.html#a5153319711f35fe81cbc13f4b852450cThe Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Since: 0.12.2
gboolean gexiv2_metadata_try_tag_supports_multiple_values (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at https://www.exiv2.org/metadata.html
Multiple value tags are Xmp tags of type "XmpAlt", "XmpBag", "XmpSeq" or "LangAlt", or Iptc tags marked as Repeatable (which can be of any Iptc type). There are no multiple value Exif tags.
self |
An instance of GExiv2Metadata |
|
tag |
An Exiv2 tag |
|
error |
A return location for a GError or |
[allow-none] |
Whether tag
is capable of storing multiple values or not. If tag
is undefined
(i.e. not built-in and not added to self
), then error
is set and FALSE
is returned.
Since: 0.14.0
const gchar *
gexiv2_metadata_get_mime_type (GExiv2Metadata *self
);
Query mime type of currently loaded image.
gint
gexiv2_metadata_get_pixel_width (GExiv2Metadata *self
);
Get the actual unoriented display width in pixels of the loaded image. May be different than the width reported by various metadata tags, i.e. "Exif.Photo.PixelXDimension".
gint
gexiv2_metadata_get_pixel_height (GExiv2Metadata *self
);
Get the actual unoriented display height in pixels of the loaded image. This may be different than the height reported by various metadata tags, i.e. "Exif.Photo.PixelYDimension".
gchar * gexiv2_metadata_try_get_tag_string (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Tags that support multiple values are returned as a single string, with elements separated by ", ".
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
gboolean gexiv2_metadata_try_set_tag_string (GExiv2Metadata *self
,const gchar *tag
,const gchar *value
,GError **error
);
If a tag supports multiple values, then value
is added to any existing values. For single
tags, value
replaces the value.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
value |
The value to set or replace the existing value |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
gchar * gexiv2_metadata_try_get_tag_interpreted_string (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
An interpreted string is one fit for user display. It may display units or use formatting appropriate to the type of data the tag holds.
Tags that support multiple values are returned as a single string, with elements separated by ", ".
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
glong gexiv2_metadata_try_get_tag_long (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
gboolean gexiv2_metadata_try_set_tag_long (GExiv2Metadata *self
,const gchar *tag
,glong value
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
value |
The value to set or replace the existing value |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
gchar ** gexiv2_metadata_try_get_tag_multiple (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
error |
A return location for a GError or |
[allow-none] |
The multiple string values of
tag
. Returns NULL
if parameters are NULL
or tag
does not begin with recognised type of
metadata ("Exif.", "Xmp." or "Iptc."). For a well formed tag
, returns array[0] = NULL
if tag
is undefined or is not set in the current metadata.
[transfer full][allow-none][array zero-terminated=1]
Since: 0.12.2
gboolean gexiv2_metadata_try_set_tag_multiple (GExiv2Metadata *self
,const gchar *tag
,const gchar **values
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
All previous tag
values are erased. For multiple value tags, each of the non NULL
entries in values
is stored. For single value tags, only the last non NULL
value
is assigned.
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
values |
An array of values to set or replace the existing value(s). |
[array zero-terminated=1] |
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
GBytes * gexiv2_metadata_try_get_tag_raw (GExiv2Metadata *self
,const gchar *tag
,GError **error
);
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Tags that support multiple values may be returned as a single byte array, with records separated by 4x INFORMATION SEPARATOR FOUR (ASCII 0x1c)
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.12.2
gboolean gexiv2_metadata_has_tag (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_has_tag
has been deprecated since version 0.14.0 and should not be used in newly-written code.
Use gexiv2_metadata_try_has_tag()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
gboolean gexiv2_metadata_clear_tag (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_clear_tag
has been deprecated since version 0.14.0 and should not be used in newly-written code.
Use gexiv2_metadata_try_clear_tag()
instead.
Removes the Exiv2 tag from the metadata object.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
const gchar *
gexiv2_metadata_get_tag_label (const gchar *tag
);
gexiv2_metadata_get_tag_label
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_label()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
const gchar *
gexiv2_metadata_get_tag_description (const gchar *tag
);
gexiv2_metadata_get_tag_description
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_description()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
const gchar *
gexiv2_metadata_get_tag_type (const gchar *tag
);
gexiv2_metadata_get_tag_type
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_type()
instead.
The names of the various Exiv2 tag types can be found at Exiv2::TypeId,
http://exiv2.org/doc/namespaceExiv2.html#a5153319711f35fe81cbc13f4b852450cThe Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
gchar * gexiv2_metadata_get_tag_string (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_get_tag_string
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_string()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Tags that support multiple values are returned as a single string, with elements separated by ", ".
In case of error, a GLib warning will be logged. Use instead
gexiv2_metadata_try_get_tag_string()
if you want to avoid this and
control if and how the error is outputted.
gboolean gexiv2_metadata_set_tag_string (GExiv2Metadata *self
,const gchar *tag
,const gchar *value
);
gexiv2_metadata_set_tag_string
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_set_tag_string()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
If a tag supports multiple values, then value
is added to any existing values. For single
value tags, value
replaces the value.
In case of error, a GLib warning will be logged. Use instead
gexiv2_metadata_try_set_tag_string()
if you want to avoid this and
control if and how the error is outputted.
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
value |
The value to set or replace the existing value |
gchar * gexiv2_metadata_get_tag_interpreted_string (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_get_tag_interpreted_string
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_interpreted_string()
instead.
An interpreted string is one fit for user display. It may display units or use formatting appropriate to the type of data the tag holds.
Tags that support multiple values are returned as a single string, with elements separated by ", ".
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
glong gexiv2_metadata_get_tag_long (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_get_tag_long
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_long()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
gboolean gexiv2_metadata_set_tag_long (GExiv2Metadata *self
,const gchar *tag
,glong value
);
gexiv2_metadata_set_tag_long
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_set_tag_long()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
value |
The value to set or replace the existing value |
gchar ** gexiv2_metadata_get_tag_multiple (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_get_tag_multiple
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_multiple()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
In case of error, a GLib warning will be logged. Use instead
gexiv2_metadata_try_get_tag_multiple()
if you want to avoid this and
control if and how the error is outputted.
The multiple string values of
the tag. Returns NULL
if parameters are NULL
or tag
does not begin with recognised type of
metadata ("Exif.", "Xmp." or "Iptc."). For a well formed tag
, returns array[0] = NULL
if tag
is undefined or is not set in the current metadata.
(Note: xmpText/langAlt bug
is fixed in gexiv2_metadata_try_get_tag_multiple()
).
[transfer full][allow-none][array zero-terminated=1]
gboolean gexiv2_metadata_set_tag_multiple (GExiv2Metadata *self
,const gchar *tag
,const gchar **values
);
gexiv2_metadata_set_tag_multiple
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_set_tag_multiple()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
All previous tag
values are erased. For multiple value tags, each of the non NULL
entries in values
is stored. For single value tags, only the last non NULL
value
is assigned.
In case of error, a GLib warning will be logged. Use instead
gexiv2_metadata_try_set_tag_multiple()
if you want to avoid this and
control if and how the error is outputted.
self |
An instance of GExiv2Metadata |
|
tag |
Exiv2 tag name |
|
values |
An array of values to set or replace the existing value(s). |
[array zero-terminated=1] |
GBytes * gexiv2_metadata_get_tag_raw (GExiv2Metadata *self
,const gchar *tag
);
gexiv2_metadata_get_tag_raw
has been deprecated since version 0.12.2 and should not be used in newly-written code.
Use gexiv2_metadata_try_get_tag_raw()
instead.
The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
Tags that support multiple values may bereturned as a single byte array, with records separated by 4x INFORMATION SEPARATOR FOUR (ASCII 0x1c)
The orientation of an image is defined as the location of it's x,y origin. More than rotation, orientation allows for every variation of rotation, flips, and mirroring to be described in 3 bits of data.
A handy primer to orientation can be found at
http://jpegclub.org/exif_orientation.html
The orientation of the image is unknown |
||
The orientation of the image is without any rotation. |
||
The image is flipped on its horizontal axis |
||
The image is rotated by 180 degrees |
||
The Image is flipped on its vertical axis |
||
The image is rotated by 90 degrees clockwise and flipped on its horizontal axis |
||
The image is rotated by 90 degrees clockwise |
||
The image is rotated by 90 degrees clockwise and flipped on its vertical axis |
||
The image is rotated 270 degrees clockwise |
struct GExiv2Metadata;
An object holding all the Exiv2 metadata. Previews, if present, are also available.
As gexiv2 is only a wrapper around Exiv2, it's better to read its documentation to understand the full scope of what it offers: http://www.exiv2.org/
In particular, rather than providing a getter/setter method pair for every metadata value available for images (of which there are thousands), Exiv2 uses a dotted addressing scheme. For example, to access a photo's EXIF Orientation field, the caller passes to Exiv2 "Exif.Photo.Orientation". These tags (in Exiv2 parlance) are key to using Exiv2 (and therefore gexiv2) to its fullest.
A full reference for all supported Exiv2 tags can be found at
http://www.exiv2.org/metadata.html