static void photos_thumbnailer_generate_thumbnail_save_to_stream (GObject *source_object, GAsyncResult *res, gpointer user_data) { GCancellable *cancellable; g_autoptr (GTask) task = G_TASK (user_data); PhotosThumbnailerGenerateData *data; cancellable = g_task_get_cancellable (task); data = g_task_get_task_data (task); { g_autoptr (GError) error = NULL; if (!gdk_pixbuf_save_to_stream_finish (res, &error)) { g_task_return_error (task, g_steal_pointer (&error)); goto out; } } g_output_stream_close_async (G_OUTPUT_STREAM (data->stream), G_PRIORITY_DEFAULT, cancellable, photos_thumbnailer_generate_thumbnail_stream_close, g_object_ref (task)); out: return; }
static void save_pixbuf_ready_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GError *error = NULL; ScreenshotApplication *self = user_data; gdk_pixbuf_save_to_stream_finish (res, &error); if (error != NULL) { save_pixbuf_handle_error (self, error); g_error_free (error); return; } save_pixbuf_handle_success (self); }
static void save_pixbuf_ready_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GError *error = NULL; ScreenshotDialog *dialog = user_data; gdk_pixbuf_save_to_stream_finish (res, &error); if (error != NULL) { save_file_failed_error (dialog, error); g_error_free (error); return; } save_file_completed (dialog); }
static void export_to_png_cb (GdkPixbuf *pixbuf, GAsyncResult *res) { gdk_pixbuf_save_to_stream_finish (res, NULL); }