X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fexiv2.cc;h=0ad5c6159c6cb7f130b2a52175be2a23351f1deb;hp=49b8e07c9eb0ef4dba8f5a913840f3bbd03eeec5;hb=50f5ef3cedbeaa251a1e838bf5045a9dc7dda1ee;hpb=64b3e53dd4f9a9779478831f2449306f4ac927b8 diff --git a/src/exiv2.cc b/src/exiv2.cc index 49b8e07c..0ad5c615 100644 --- a/src/exiv2.cc +++ b/src/exiv2.cc @@ -158,6 +158,10 @@ struct _ExifData virtual void add_jpeg_color_profile(unsigned char *cp_data, guint cp_length) = 0; virtual guchar *get_jpeg_color_profile(guint *data_len) = 0; + + virtual std::string image_comment() const = 0; + + virtual void set_image_comment(const std::string& comment) = 0; }; // This allows read-only access to the original metadata @@ -280,6 +284,17 @@ public: } return NULL; } + + virtual std::string image_comment() const + { + return image_.get() ? image_->comment() : ""; + } + + virtual void set_image_comment(const std::string& comment) + { + if (image_.get()) + image_->setComment(comment); + } }; extern "C" { @@ -415,6 +430,16 @@ public: { return imageData_->get_jpeg_color_profile(data_len); } + + virtual std::string image_comment() const + { + return imageData_->image_comment(); + } + + virtual void set_image_comment(const std::string& comment) + { + imageData_->set_image_comment(comment); + } }; @@ -1133,6 +1158,23 @@ guchar *exif_get_color_profile(ExifData *exif, guint *data_len) return ret; } +gchar* exif_get_image_comment(FileData* fd) +{ + if (!fd || !fd->exif) + return g_strdup(""); + + return g_strdup(fd->exif->image_comment().c_str()); +} + +void exif_set_image_comment(FileData* fd, const gchar* comment) +{ + if (!fd || !fd->exif) + return; + + fd->exif->set_image_comment(comment ? comment : ""); +} + + #if EXIV2_TEST_VERSION(0,17,90) guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, gint requested_height)