Index: darktable-2.2.5/src/common/exif.cc =================================================================== --- darktable-2.2.5.orig/src/common/exif.cc +++ darktable-2.2.5/src/common/exif.cc @@ -82,6 +82,13 @@ const char *dt_xmp_keys[] static const guint dt_xmp_keys_n = G_N_ELEMENTS(dt_xmp_keys); // the number of XmpBag XmpSeq keys that dt uses +#if ! GLIB_CHECK_VERSION(2,40,0) +static gboolean _str_is_ascii(const char *str) +{ + while(*str) if((guchar)*str++ >= 0x80) return FALSE; + return TRUE; +} +#endif /* a few helper functions inspired by https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/revisions/master/entry/libkexiv2/kexiv2gps.cpp @@ -1356,7 +1363,11 @@ int dt_exif_read_blob(uint8_t **buf, con if(res != NULL) { char *desc = (char *)res->data; +#if GLIB_CHECK_VERSION(2,40,0) if(g_str_is_ascii(desc)) +#else + if(_str_is_ascii(desc)) +#endif exifData["Exif.Image.ImageDescription"] = desc; else exifData["Exif.Photo.UserComment"] = desc;