[gnome-shell/wip/carlosg/issue-1017: 17/17] shell: Fallback on ISO 8601 datetime string for screenshot date info



commit 1b5e91e4b3f6f6f035c768865d220b36f945c616
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Apr 1 18:06:49 2019 +0200

    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

 src/shell-screenshot.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index 61fdc1d1e..c9743f42d 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]