Commit b80580d3 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

Fixed comment lost when upgrading from 2.10 to 2.11

When reading the embedded comment give priority to Iptc::caption
and Xmp::dc::description as in 2.10 they were used to save the
description.
When writing the embedded data save the title in Iptc::headline and
the comment in Iptc::caption.

[bug #626893]
parent ea158f7b
......@@ -140,12 +140,12 @@ const char *_ORIENTATION_TAG_NAMES[] = {
};
const char *_DESCRIPTION_TAG_NAMES[] = {
"Iptc::Application2::Caption",
"Xmp::dc::description",
"Exif::Photo::UserComment",
"Exif::Image::ImageDescription",
"Xmp::dc::description",
"Xmp::tiff::ImageDescription",
"Iptc::Application2::Headline",
"Iptc::Application2::Caption",
NULL
};
......@@ -363,8 +363,8 @@ set_attributes_from_tagsets (GFileInfo *info)
set_attribute_from_tagset (info, "general::description", _DESCRIPTION_TAG_NAMES);
set_attribute_from_tagset (info, "general::title", _TITLE_TAG_NAMES);
/* if iptc::caption and iptc::headline are different use iptc::caption
* to set general::title, if not alreay set. */
/* if iptc::caption and iptc::headline are different use iptc::headline
* to set general::title, if not already set. */
if (g_file_info_get_attribute_object (info, "general::title") == NULL) {
GObject *iptc_caption;
......@@ -378,7 +378,7 @@ set_attributes_from_tagsets (GFileInfo *info)
&& (g_strcmp0 (gth_metadata_get_raw (GTH_METADATA (iptc_caption)),
gth_metadata_get_raw (GTH_METADATA (iptc_headline))) != 0))
{
set_attribute_from_metadata (info, "general::title", iptc_caption);
set_attribute_from_metadata (info, "general::title", iptc_headline);
}
}
......
......@@ -137,7 +137,7 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
const char *tags_to_remove[] = {
"Exif::Image::ImageDescription",
"Xmp::tiff::ImageDescription",
"Iptc::Application2::Caption",
"Iptc::Application2::Headline",
NULL
};
int i;
......@@ -147,13 +147,13 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Exif::Photo::UserComment", metadata);
g_file_info_set_attribute_object (file_data->info, "Xmp::dc::description", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Headline", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Caption", metadata);
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::title");
if (metadata != NULL) {
g_file_info_set_attribute_object (file_data->info, "Xmp::dc::title", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Caption", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Headline", metadata);
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::location");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment