File darktable-old-glib.patch of Package darktable
Index: darktable/src/common/exif.cc
===================================================================
--- darktable.orig/src/common/exif.cc 2021-06-20 19:40:04.426410553 +0200
+++ darktable/src/common/exif.cc 2021-06-20 19:46:21.658809959 +0200
@@ -591,6 +591,13 @@ static bool dt_exif_read_iptc_tag(Exiv2:
}
#define FIND_IPTC_TAG(key) dt_exif_read_iptc_tag(iptcData, &pos, key)
+#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
// FIXME: according to http://www.exiv2.org/doc/classExiv2_1_1Metadatum.html#63c2b87249ba96679c29e01218169124
// there is no need to pass iptcData
@@ -1776,7 +1783,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;