+static gboolean
+save_image_tiff (const gchar *filename, GdkPixbuf *pixbuf, GError **error)
+{
+ gchar *contents = NULL;
+ gchar *contents_encode = NULL;
+ gsize length;
+ gboolean ret;
+ gint len;
+
+ /* get icc file */
+ ret = g_file_get_contents (ICC_PROFILE, &contents, &length, error);
+ if (!ret)
+ goto out;
+ contents_encode = g_base64_encode ((const guchar *) contents, length);
+ ret = gdk_pixbuf_save (pixbuf, filename, "tiff", error,
+ "icc-profile", contents_encode,
+ NULL);
+ len = strlen (contents_encode);
+ g_debug ("ICC profile was %i bytes", len);
+out:
+ g_free (contents);
+ g_free (contents_encode);
+ return ret;
+}
+