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: <ulink
url="http://www.exiv2.org/"></ulink>
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 <emphasis>tags</emphasis> (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 <ulink url="http://www.exiv2.org/metadata.html"></ulink>
- public void clear ()
Removes all tags for all domains (EXIF, IPTC, and XMP).
- public void clear_comment ()
This is a composite clear method that will clear a number of fields.
- public void clear_exif ()
Clears all EXIF metadata from the loaded image.
- public void clear_iptc ()
Clears all IPTC metadata from the loaded image.
- public bool clear_tag (string tag)
Removes the Exiv2 tag from the metadata object.
- public void clear_xmp ()
Clears all XMP metadata from the loaded image.
- public void delete_gps_info ()
Removes all GPS metadata from the loaded image
- public void erase_exif_thumbnail ()
Removes the EXIF thumbnail from the loaded image.
- public void free ()
Destroys the Metadata object and frees all
associated memory.
- public bool from_app1_segment (uint8[] data) throws Error
Load only an EXIF buffer, typically stored in a JPEG's APP1 segment.
- public bool from_stream (InputStream stream) throws Error
This function does not work and will be removed in a future release.
- public string? generate_xmp_packet (XmpFormatFlags xmp_format_flags, uint32 padding)
Encode the XMP packet as a null
-terminated string.
- public string? get_comment ()
A composite accessor that uses the first available metadata field from
a list of well-known locations to find the photo's comment (or description).
- public Bytes? get_exif_data (ByteOrder byte_order) throws Error
- public bool get_exif_tag_rational (string tag, out int nom, out int den)
Fetch EXIF tag
represented by a fraction.
- public string[] get_exif_tags ()
Query this for a list of available
EXIF tags
- public bool get_exif_thumbnail (out uint8[] buffer)
Get the thumbnail stored in the EXIF data of
this
- public bool get_exposure_time (out int nom, out int den)
Returns the exposure time in seconds (shutter speed, <emphasis>
not</emphasis> date-time of exposure) as a rational.
- public double get_fnumber ()
See <ulink url="https://en.
- public double get_focal_length ()
See <ulink url="https://en.
- public bool get_gps_altitude (out double altitude)
Convenience function to query the altitude stored in the GPS tags of
the image
- public bool get_gps_info (out double longitude, out double latitude, out double altitude)
Convenience function to query all available GPS information at once.
- public bool get_gps_latitude (out double latitude)
Query the latitude stored in the GPS tags of
this
- public bool get_gps_longitude (out double longitude)
Query the longitude stored in the GPS tags of
this
- public string[] get_iptc_tags ()
Query this for a list of available
IPTC tags
- public int get_iso_speed ()
See <ulink url="https://en.
- public int get_metadata_pixel_height ()
Composite accessor to query the pixel with stored in the metadata.
- public int get_metadata_pixel_width ()
Composite accessor to query the pixel with stored in the metadata.
- public unowned string get_mime_type ()
Query mime type of currently loaded image.
- public Orientation get_orientation ()
The EXIF Orientation field
- public int get_pixel_height ()
Get the <emphasis>actual</emphasis> unoriented display
height in pixels of the loaded image.
- public int get_pixel_width ()
Get the <emphasis>actual</emphasis> unoriented display
width in pixels of the loaded image.
- public PreviewImage get_preview_image (PreviewProperties props)
- public unowned PreviewProperties[]? get_preview_properties ()
An image may have stored one or more previews, often of different
qualities, sometimes of different image formats than the containing image.
- public bool get_supports_exif ()
Query this whether it supports
writing EXIF metadata.
- public bool get_supports_iptc ()
Query this whether it supports
writing IPTC metadata.
- public bool get_supports_xmp ()
Query this whether it supports
writing XMP metadata.
- public string? get_tag_interpreted_string (string tag)
An interpreted string is one fit for user display.
- public long get_tag_long (string tag)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string[]? get_tag_multiple (string tag)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public Bytes? get_tag_raw (string tag)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string? get_tag_string (string tag)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string? get_xmp_packet ()
- public string[] get_xmp_tags ()
- public bool has_exif ()
- public bool has_iptc ()
- public bool has_tag (string tag)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool has_xmp ()
- public bool open_buf (uint8[] data) throws Error
The buffer must be an image format supported by Exiv2.
- public bool open_path (string path) throws Error
The file must be an image format supported by Exiv2.
- public bool save_external (string path) throws Error
Saves the metadata to the specified using an XMP sidecar file.
- public bool save_file (string path) throws Error
Saves the metadata to the specified file by reading the file into
memory,copying this object's metadata into the image, then writing the image back out.
- public void set_comment (string comment)
This is a composite setter that will set a number of fields to the
supplied value.
- public bool set_exif_tag_rational (string tag, int nom, int den)
Set EXIF tag
represented by a fraction, with nom
being the numerator, den
the denominator of the fraction.
- public void set_exif_thumbnail_from_buffer (uint8[] buffer)
- public bool set_exif_thumbnail_from_file (string path) throws Error
Sets or replaces the EXIF thumbnail with the image in the file
- public bool set_gps_info (double longitude, double latitude, double altitude)
Convenience function to create a new set of simple GPS data.
- public void set_metadata_pixel_height (int height)
Update the image's metadata with height
- public void set_metadata_pixel_width (int width)
Composite setter to update the image's metadata with width
- public void set_orientation (Orientation orientation)
The orientation must be valid and cannot be
UNSPECIFIED.
- public bool set_tag_long (string tag, long value)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool set_tag_multiple (string tag, string[] values)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool set_tag_string (string tag, string value)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool set_xmp_tag_struct (string tag, StructureType type)
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool try_clear_tag (string tag) throws Error
Removes the Exiv2 tag from the metadata object.
- public void try_delete_gps_info () throws Error
Removes all GPS metadata from the loaded image
- public void try_erase_exif_thumbnail () throws Error
Removes the EXIF thumbnail from the loaded image.
- public string? try_generate_xmp_packet (XmpFormatFlags xmp_format_flags, uint32 padding) throws Error
Encode the XMP packet as a null
-terminated string.
- public string? try_get_comment () throws Error
A composite accessor that uses the first available metadata field from
a list of well-known locations to find the photo's comment (or description).
- public bool try_get_exif_tag_rational (string tag, out int nom, out int den) throws Error
Fetch EXIF tag
represented by a fraction.
- public bool try_get_exposure_time (out int nom, out int den) throws Error
Returns the exposure time in seconds (shutter speed, <emphasis>
not</emphasis> date-time of exposure) as a rational.
- public double try_get_fnumber () throws Error
See <ulink url="https://en.
- public double try_get_focal_length () throws Error
See <ulink url="https://en.
- public bool try_get_gps_altitude (out double altitude) throws Error
Convenience function to query the altitude stored in the GPS tags of
the image
- public bool try_get_gps_info (out double longitude, out double latitude, out double altitude) throws Error
Convenience function to query all available GPS information at once.
- public bool try_get_gps_latitude (out double latitude) throws Error
Query the latitude stored in the GPS tags of
this
- public bool try_get_gps_longitude (out double longitude) throws Error
Query the longitude stored in the GPS tags of
this
- public int try_get_iso_speed () throws Error
See <ulink url="https://en.
- public int try_get_metadata_pixel_height () throws Error
Composite accessor to query the pixel with stored in the metadata.
- public int try_get_metadata_pixel_width () throws Error
Composite accessor to query the pixel with stored in the metadata.
- public Orientation try_get_orientation () throws Error
The EXIF Orientation field
- public PreviewImage try_get_preview_image (PreviewProperties props) throws Error
- public string? try_get_tag_interpreted_string (string tag) throws Error
An interpreted string is one fit for user display.
- public long try_get_tag_long (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string[]? try_get_tag_multiple (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public Bytes? try_get_tag_raw (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string? try_get_tag_string (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public string? try_get_xmp_packet () throws Error
- public bool try_has_tag (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public void try_set_comment (string comment) throws Error
This is a composite setter that will set a number of fields to the
supplied value.
- public bool try_set_exif_tag_rational (string tag, int nom, int den) throws Error
Set EXIF tag
represented by a fraction, with nom
being the numerator, den
the denominator of the fraction.
- public void try_set_exif_thumbnail_from_buffer (uint8[] buffer) throws Error
- public bool try_set_gps_info (double longitude, double latitude, double altitude) throws Error
Convenience function to create a new set of simple GPS data.
- public void try_set_metadata_pixel_height (int height) throws Error
Update the image's metadata with height
- public void try_set_metadata_pixel_width (int width) throws Error
Composite setter to update the image's metadata with width
- public void try_set_orientation (Orientation orientation) throws Error
The orientation must be valid and cannot be
UNSPECIFIED.
- public bool try_set_tag_long (string tag, long value) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool try_set_tag_multiple (string tag, string[] values) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool try_set_tag_string (string tag, string value) throws Error
If a tag supports multiple values, then value
is added to
any existing values.
- public bool try_set_xmp_tag_struct (string tag, StructureType type) throws Error
The Exiv2 Tag Reference can be found at <ulink url="http://exiv2.
- public bool try_tag_supports_multiple_values (string tag) throws Error
The Exiv2 Tag Reference can be found at <ulink url="https://www.
- public bool try_update_gps_info (double longitude, double latitude, double altitude) throws Error
Convenience function to update longitude, latitude and altitude at
once.
- public bool update_gps_info (double longitude, double latitude, double altitude)
Convenience function to update longitude, latitude and altitude at
once.