[gthumb/gthumb-2-12] delete the exif attributes if not set
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb/gthumb-2-12] delete the exif attributes if not set
- Date: Tue, 28 Dec 2010 17:23:30 +0000 (UTC)
commit 4140465f77c59e3a0b5657381f21c11359f1dcac
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Dec 28 16:41:22 2010 +0100
delete the exif attributes if not set
.../exiv2_tools/gth-metadata-provider-exiv2.c | 29 ++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
index 984459c..68623e1 100644
--- a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
+++ b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
@@ -172,6 +172,21 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, tags_to_update[i], metadata);
}
}
+ else {
+ const char *tags_to_remove[] = {
+ "Exif::Image::ImageDescription",
+ "Xmp::tiff::ImageDescription",
+ "Iptc::Application2::Headline",
+ "Exif::Photo::UserComment",
+ "Xmp::dc::description",
+ "Iptc::Application2::Caption",
+ NULL
+ };
+ int i;
+
+ for (i = 0; tags_to_remove[i] != NULL; i++)
+ g_file_info_remove_attribute (file_data->info, tags_to_remove[i]);
+ }
metadata = g_file_info_get_attribute_object (file_data->info, "general::title");
if (metadata != NULL) {
@@ -179,6 +194,10 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::dc::title", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Headline", metadata);
}
+ else {
+ g_file_info_remove_attribute (file_data->info, "Xmp::dc::title");
+ g_file_info_remove_attribute (file_data->info, "Iptc::Application2::Headline");
+ }
metadata = g_file_info_get_attribute_object (file_data->info, "general::location");
if (metadata != NULL) {
@@ -186,6 +205,10 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::iptc::Location", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::LocationName", metadata);
}
+ else {
+ g_file_info_remove_attribute (file_data->info, "Xmp::iptc::Location");
+ g_file_info_remove_attribute (file_data->info, "Iptc::Application2::LocationName");
+ }
metadata = g_file_info_get_attribute_object (file_data->info, "general::tags");
if (metadata != NULL) {
@@ -194,12 +217,18 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::iptc::Keywords", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Keywords", metadata);
}
+ else {
+ g_file_info_remove_attribute (file_data->info, "Xmp::iptc::Keywords");
+ g_file_info_remove_attribute (file_data->info, "Iptc::Application2::Keywords");
+ }
metadata = g_file_info_get_attribute_object (file_data->info, "general::datetime");
if (metadata != NULL) {
g_object_set (metadata, "value-type", NULL, NULL);
g_file_info_set_attribute_object (file_data->info, "Exif::Image::DateTime", metadata);
}
+ else
+ g_file_info_remove_attribute (file_data->info, "Exif::Image::DateTime");
if (exiv2_write_metadata_to_buffer (&buffer,
&size,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]