Commit 0c59d644 authored by Carlos Garnacho's avatar Carlos Garnacho

tracker-extract-png: Ensure UTF8-ness of metadata strings

Some image metadata formats (Exif, Iptc) don't have encoding
guarantees, so do our best here.

GNOME/tracker-miners#13

Closes: #13
parent 98136e11
......@@ -361,11 +361,11 @@ read_metadata (TrackerResource *metadata,
keywords = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free);
if (md.comment) {
tracker_resource_set_string (metadata, "nie:comment", md.comment);
tracker_guarantee_resource_utf8_string (metadata, "nie:comment", md.comment);
}
if (md.license) {
tracker_resource_set_string (metadata, "nie:license", md.license);
tracker_guarantee_resource_utf8_string (metadata, "nie:license", md.license);
}
/* TODO: add ontology and store this ed->software */
......@@ -384,11 +384,11 @@ read_metadata (TrackerResource *metadata,
uri);
if (md.description) {
tracker_resource_set_string (metadata, "nie:description", md.description);
tracker_guarantee_resource_utf8_string (metadata, "nie:description", md.description);
}
if (md.copyright) {
tracker_resource_set_string (metadata, "nie:copyright", md.copyright);
tracker_guarantee_resource_utf8_string (metadata, "nie:copyright", md.copyright);
}
tracker_guarantee_resource_title_from_file (metadata,
......
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