[gnome-photos] facebook-item: Use photos_utils_file_copy_as_thumbnail



commit 1140966247705e2f613edda71be22053bb8f7317
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 14 15:33:09 2017 +0100

    facebook-item: Use photos_utils_file_copy_as_thumbnail
    
    From now on the thumbnails will actually be PNG files, instead of being
    JPEG data stored with a '*.png' extension.

 src/photos-facebook-item.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-facebook-item.c b/src/photos-facebook-item.c
index dfd886b..91d7fbe 100644
--- a/src/photos-facebook-item.c
+++ b/src/photos-facebook-item.c
@@ -141,6 +141,8 @@ photos_facebook_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cance
   const gchar *uri;
   gchar *local_dir = NULL;
   gchar *local_path = NULL;
+  gint64 height;
+  gint64 width;
   guint size;
 
   photo = photos_facebook_get_gfbgraph_photo (item, cancellable, error);
@@ -164,14 +166,17 @@ photos_facebook_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cance
   local_dir = g_path_get_dirname (local_path);
   g_mkdir_with_parents (local_dir, 0700);
 
+  height = photos_base_item_get_height (item);
+  width = photos_base_item_get_width (item);
+
   photos_debug (PHOTOS_DEBUG_NETWORK, "Downloading %s from Facebook to %s", thumbnail_image->source, 
local_path);
-  if (!g_file_copy (remote_file,
-                    local_file,
-                    G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE,
-                    cancellable,
-                    NULL,
-                    NULL,
-                    error))
+  if (!photos_utils_file_copy_as_thumbnail (remote_file,
+                                            local_file,
+                                            uri,
+                                            height,
+                                            width,
+                                            cancellable,
+                                            error))
     goto out;
 
   ret_val = TRUE;


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