Top |
Reading and writing metadataReading and writing metadata — How to read and write metadata from files and memory |
gboolean | gexiv2_metadata_open_path () |
gboolean | gexiv2_metadata_open_buf () |
gboolean | gexiv2_metadata_from_stream () |
gboolean | gexiv2_metadata_from_app1_segment () |
gboolean | gexiv2_metadata_save_external () |
gboolean | gexiv2_metadata_save_file () |
gboolean | gexiv2_metadata_open_stream () |
gboolean | gexiv2_metadata_save_stream () |
gboolean | (*Stream_CanSeek) () |
gboolean | (*Stream_CanRead) () |
gboolean | (*Stream_CanWrite) () |
gint64 | (*Stream_Length) () |
gint64 | (*Stream_Position) () |
gint32 | (*Stream_Read) () |
void | (*Stream_Write) () |
void | (*Stream_Seek) () |
void | (*Stream_Flush) () |
gboolean gexiv2_metadata_open_path (GExiv2Metadata *self
,const gchar *path
,GError **error
);
The file must be an image format supported by Exiv2.
self |
An instance of GExiv2Metadata |
|
path |
Path to the file you want to open |
|
error |
A return location for a GError or |
[allow-none] |
gboolean gexiv2_metadata_open_buf (GExiv2Metadata *self
,const guint8 *data
,glong n_data
,GError **error
);
The buffer must be an image format supported by Exiv2.
self |
An instance of GExiv2Metadata |
|
data |
A buffer containing the data to be read. |
[array length=n_data] |
n_data |
The length of the buffer. |
[skip] |
error |
A return location for a GError or |
[allow-none] |
gboolean gexiv2_metadata_from_stream (GExiv2Metadata *self
,GInputStream *stream
,GError **error
);
gexiv2_metadata_from_stream
is deprecated and should not be used in newly-written code.
This function does not work and will be removed in a future release.
gboolean gexiv2_metadata_from_app1_segment (GExiv2Metadata *self
,const guint8 *data
,glong n_data
,GError **error
);
Load only an EXIF buffer, typically stored in a JPEG's APP1 segment.
self |
An instance of GExiv2Metadata |
|
data |
A buffer containing the data to be read. |
[array length=n_data] |
n_data |
The length of the buffer. |
[skip] |
error |
A return location for a GError or |
[allow-none] |
gboolean gexiv2_metadata_save_external (GExiv2Metadata *self
,const gchar *path
,GError **error
);
Saves the metadata to the specified using an XMP sidecar file.
self |
An instance of GExiv2Metadata |
|
path |
Path to the file you want to save to. |
|
error |
A return location for a GError or |
[allow-none] |
Since: 0.10.6
gboolean gexiv2_metadata_save_file (GExiv2Metadata *self
,const gchar *path
,GError **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.
self |
An instance of GExiv2Metadata |
|
path |
Path to the file you want to save to. |
|
error |
A return location for a GError or |
[allow-none] |
gboolean gexiv2_metadata_open_stream (GExiv2Metadata *self
,ManagedStreamCallbacks *cb
,GError **error
);
gexiv2_metadata_open_stream
is deprecated and should not be used in newly-written code.
The stream must be an image format supported by Exiv2.
[skip]
self |
An instance of GExiv2Metadata |
|
cb |
A ManagedStreamCallbacks struct offering stream access. |
|
error |
A return location for a GError or |
[allow-none] |
gboolean gexiv2_metadata_save_stream (GExiv2Metadata *self
,ManagedStreamCallbacks *cb
,GError **error
);
gexiv2_metadata_save_stream
is deprecated and should not be used in newly-written code.
Saves the metadata to the stream by reading the stream into memory,copying this object's metadata into the image, then writing the image as a stream back out.
[skip]
self |
An instance of GExiv2Metadata |
|
cb |
A ManagedStreamCallbacks struct offering stream access. |
|
error |
A return location for a GError or |
[allow-none] |
gboolean
(*Stream_CanSeek) (void *handle
);
Function that returns the seekability of the stream
gboolean
(*Stream_CanRead) (void *handle
);
Function that returns the readability of the stream
gboolean
(*Stream_CanWrite) (void *handle
);
Function that returns the readability of the stream
gint64
(*Stream_Position) (void *handle
);
Function to query the current position in the stream
gint32 (*Stream_Read) (void *handle
,void *buffer
,gint32 offset
,gint32 count
);
Function to read data from the stream
void (*Stream_Write) (void *handle
,void *buffer
,gint32 offset
,gint32 count
);
Function to write data to the stream
void (*Stream_Seek) (void *handle
,gint64 offset
,WrapperSeekOrigin origin
);
Change the read or write position in the current stream
typedef struct { void *handle; Stream_CanSeek CanSeek; Stream_CanRead CanRead; Stream_CanWrite CanWrite; Stream_Length Length; Stream_Position Position; Stream_Read Read; Stream_Write Write; Stream_Seek Seek; Stream_Flush Flush; } ManagedStreamCallbacks;
ManagedStreamCallbacks is a set of callbacks that describe a stream that
can be passed to gexiv2_metadata_open_stream()
to read image meta-data from
arbitrary data sources that can be mapped to this set of callbacks.
At least CanSeek
and CanRead
need to return TRUE and the relevant
call-backs must not be NULL to be any useful.
Storage for the native handle to be used with this stream |
||
Stream_CanSeek |
Pointer to a function that describes the seekability of |
|
Stream_CanRead |
Pointer to a function that describes the readability of |
|
Stream_CanWrite |
Pointer to a function that describes the writability of |
|
Stream_Length |
Pointer to a function that gets the length of |
|
Stream_Position |
Pointer to a function that gives the current location inside |
|
Stream_Read |
Read bytes from the stream |
|
Stream_Write |
Function pointer to write to the stream. Can be NULL if |
[nullable] |
Stream_Seek |
Function pointer to seek in the stream. |
|
Stream_Flush |
Function pointer schedule writing of all cached data to disk. Can
be NULL if |
[nullable] |