shell: Fallback on ISO 8601 datetime string for screenshot date info

If the locale doesn't honor strftime()'s %c argument, we would end up
feeding NULLs into GdkPixbuf tagging. Fallback to a sensible (although
not nicely localized) datetime string.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1017
This commit is contained in:
Carlos Garnacho 2019-04-01 18:06:49 +02:00 committed by Florian Müllner
parent 727195c767
commit 1b5e91e4b3

View File

@ -202,6 +202,9 @@ write_screenshot_thread (GTask *result,
cairo_image_surface_get_height (priv->image));
creation_time = g_date_time_format (priv->datetime, "%c");
if (!creation_time)
creation_time = g_date_time_format (priv->datetime, "%FT%T%z");
if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
"tEXt::Software", "gnome-screenshot",
"tEXt::Creation Time", creation_time,