for (i = 0; ExifUIList[i].key; i++)
{
- const gchar *text;
+ gchar *text;
text = exif_get_description_by_key(ExifUIList[i].key);
eb->labels[i] = table_add_line(table, 0, i, text, NULL,
&eb->keys[i]);
+ g_free(text);
}
eb->custom_sep = gtk_hseparator_new();
return NULL;
}
-const gchar *exif_get_description_by_key(const gchar *key)
+gchar *exif_get_description_by_key(const gchar *key)
{
if (!key) return NULL;
key += 10;
for (i = 0; ExifFormattedList[i].key; i++)
if (strcmp(key, ExifFormattedList[i].key + 10) == 0)
- return _(ExifFormattedList[i].description);
+ return g_strdup(_(ExifFormattedList[i].description));
}
return exif_get_tag_description_by_key(key);
return NULL;
}
-const gchar *exif_get_tag_description_by_key(const gchar *key)
+gchar *exif_get_tag_description_by_key(const gchar *key)
{
gint i;
i = 0;
while (ExifKnownMarkersList[i].tag > 0)
{
- if (strcmp(key, ExifKnownMarkersList[i].key) == 0) return _(ExifKnownMarkersList[i].description);
+ if (strcmp(key, ExifKnownMarkersList[i].key) == 0) return g_strdup(_(ExifKnownMarkersList[i].description));
i++;
}
gchar *exif_item_get_string(ExifItem *item, gint idx);
-const gchar *exif_get_description_by_key(const gchar *key);
-const gchar *exif_get_tag_description_by_key(const gchar *key);
+gchar *exif_get_description_by_key(const gchar *key);
+gchar *exif_get_tag_description_by_key(const gchar *key);
gchar *exif_get_formatted_by_key(ExifData *exif, const gchar *key, gint *key_valid);
{
try {
if (!item) return NULL;
- return g_strdup(((Exiv2::Metadatum *)item)->tagLabel().c_str());
+ return g_locale_to_utf8(((Exiv2::Metadatum *)item)->tagLabel().c_str(), -1, NULL, NULL, NULL);
}
catch (std::exception& e) {
// std::cout << "Caught Exiv2 exception '" << e << "'\n";
if (!item) return NULL;
Exiv2::Metadatum *metadatum = (Exiv2::Metadatum *)item;
#if EXIV2_TEST_VERSION(0,17,0)
- return g_strdup(metadatum->print().c_str());
+ return g_locale_to_utf8(metadatum->print().c_str(), -1, NULL, NULL, NULL);
#else
std::stringstream str;
Exiv2::Exifdatum *exifdatum;
str << *xmpdatum;
#endif
- return g_strdup(str.str().c_str());
+ return g_locale_to_utf8(str.str().c_str(), -1, NULL, NULL, NULL);
#endif
}
catch (Exiv2::AnyError& e) {
if (pos != std::string::npos) str = str.substr(pos+1);
}
+// return g_locale_to_utf8(str.c_str(), -1, NULL, NULL, NULL); // FIXME
return g_strdup(str.c_str());
}
catch (Exiv2::AnyError& e) {
}
}
-const gchar *exif_get_tag_description_by_key(const gchar *key)
+gchar *exif_get_tag_description_by_key(const gchar *key)
{
try {
Exiv2::ExifKey ekey(key);
- return Exiv2::ExifTags::tagLabel(ekey.tag(), ekey.ifdId ());
+ return g_locale_to_utf8(Exiv2::ExifTags::tagLabel(ekey.tag(), ekey.ifdId ()), -1, NULL, NULL, NULL);
}
catch (Exiv2::AnyError& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
for (i = 0; ExifUIList[i].key; i++)
{
gchar *label;
+ gchar *desc;
gchar *text;
gchar *utf8_text;
continue;
}
- label = g_strdup_printf("%s:", exif_get_description_by_key(ExifUIList[i].key));
+ desc = exif_get_description_by_key(ExifUIList[i].key);
+ label = g_strdup_printf("%s:", desc);
+ g_free(desc);
utf8_text = utf8_validate_or_convert(text);
g_free(text);
pan_text_alignment_add(ta, label, utf8_text);
for (i = 0; ExifUIList[i].key; i++)
{
- const gchar *title;
+ gchar *title;
title = exif_get_description_by_key(ExifUIList[i].key);
exif_item(table, 0, i, title, ExifUIList[i].current,
&ExifUIList[i].temp);
+ g_free(title);
}
}