[gnome-photos/wip/rishi/thumbnailer: 5/5] utils: foo
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/thumbnailer: 5/5] utils: foo
- Date: Fri, 10 Feb 2017 13:36:53 +0000 (UTC)
commit fa6b2f6bfc96135864a70f3f150f89fe748f6bf3
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Feb 9 20:32:12 2017 +0100
utils: foo
src/photos-utils.c | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index db90ea3..d877722 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -61,6 +61,7 @@
#include "photos-share-point-google.h"
#include "photos-share-point-online.h"
#include "photos-source.h"
+#include "photos-thumbnail-factory.h"
#include "photos-tool.h"
#include "photos-tool-colors.h"
#include "photos-tool-crop.h"
@@ -429,31 +430,24 @@ photos_utils_create_thumbnail (GFile *file,
GCancellable *cancellable,
GError **error)
{
- GnomeDesktopThumbnailFactory *factory = NULL;
+ PhotosThumbnailFactory *factory = NULL;
gboolean ret_val = FALSE;
- gchar *uri = NULL;
+ //gchar *uri = NULL;
GdkPixbuf *pixbuf = NULL;
- uri = g_file_get_uri (file);
- factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
- pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, mime_type);
+ //uri = g_file_get_uri (file);
+ factory = photos_thumbnail_factory_dup_singleton (NULL, NULL);
+ pixbuf = photos_thumbnail_factory_generate_thumbnail (factory, file, mime_type, NULL, error);
if (pixbuf == NULL)
- {
- /* FIXME: use proper #defines and enumerated types */
- g_set_error (error,
- g_quark_from_static_string ("gnome-desktop-error"),
- 0,
- "GnomeDesktopThumbnailFactory failed");
- goto out;
- }
+ goto out;
- gnome_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, (time_t) mtime);
+ //gnome_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, (time_t) mtime);
ret_val = TRUE;
out:
g_clear_object (&pixbuf);
g_clear_object (&factory);
- g_free (uri);
+ //g_free (uri);
return ret_val;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]