Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ include = [
]

[dependencies]
glib-sys = "0.16"
libc = "0.2"
bitflags = { version = "1.3", optional = true}
glib-sys = { version = "0.16", optional = true }

[build-dependencies]
pkg-config = "0.3"
Expand All @@ -44,5 +44,5 @@ pkg-config = "0.3"
tempfile = "3.3"

[features]
raw-tag-access = ["glib-sys"]
raw-tag-access = []
xmp-packet-access = ["bitflags"]
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,13 @@ enable this feature and gain the `gexiv2_metadata_get_tag_raw` function. Note
that the return value of this call is a GLib [`GBytes`][gbytes] object, which
you can convert to a data pointer via GLib’s [`g_bytes_unref_to_data`][unref].

This feature is disabled by default because it introduces a new dependency on
[`glib-sys`][glib-sys], and consequently on the GLib system library.

**xmp-packet-access**: If you need access to the XML-formatted XMP packet, you
can enable this feature. It will add the `gexiv2_metadata_generate_xmp_packet`
and `gexiv2_metadata_get_xmp_packet` calls. Enabling the feature also introduces
a new dependency on the the [`bitflags`][bitflags] crate.

[gbytes]: http://gtk-rs.org/docs/glib_sys/struct.GBytes.html
[unref]: http://gtk-rs.org/docs/glib_sys/fn.g_bytes_unref_to_data.html
[glib-sys]: https://crates.io/crates/glib-sys/
[bitflags]: https://crates.io/crates/bitflags


Expand Down
23 changes: 10 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ pub enum GExiv2PreviewProperties {}
/// Be sure to free it with [`gexiv2_preview_image_free()`](fn.gexiv2_preview_image_free.html).
pub enum GExiv2PreviewImage {}

extern crate glib_sys as glib;

/// Container for information about recoverable runtime errors.
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct GError {
/// Part of the program from which the error originated.
pub domain: u32,
/// Identifier for the error that occurred.
pub code: c_int,
/// Human-readable description of the problem.
pub message: *const c_char,
}
///
/// Be sure to free it with [`g_error_free`](fn.g_error_free.html).
///
/// See <https://docs.gtk.org/glib/struct.Error.html>.
pub type GError = glib::GError;

/// Frees a [`GError`](type.GError.html) and associated resources.
pub use glib::g_error_free;

/// All the possible orientations for an image.
#[repr(C)]
Expand Down Expand Up @@ -207,9 +207,6 @@ extern "C" {
}


#[cfg(feature = "raw-tag-access")]
extern crate glib_sys as glib;

#[cfg(feature = "raw-tag-access")]
extern "C" {
pub fn gexiv2_metadata_get_tag_raw(this: *mut GExiv2Metadata, tag: *const libc::c_char) -> *mut glib::GBytes;
Expand Down
Loading