[gnome-photos] base-item: Save JPEGs at quality=90



commit 6afe3eff1deb594c4dc5b8fe4ad5bc8cc8a5e047
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Dec 24 02:26:02 2015 +0100

    base-item: Save JPEGs at quality=90
    
    This is the default setting in GIMP [1] and GEGL since 2011. We can
    afford it in these days of large hard disks and broadband.
    
    [1] GIMP commit dd912b1cb954e5d9e5bc569075de8b0e904a4ad2

 src/photos-base-item.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index c14c1a1..a6f2433 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -987,13 +987,27 @@ photos_base_item_save_replace (GObject *source_object, GAsyncResult *res, gpoint
       goto out;
     }
 
-  gdk_pixbuf_save_to_stream_async (pixbuf,
-                                   G_OUTPUT_STREAM (stream),
-                                   type,
-                                   cancellable,
-                                   photos_base_item_save_save_to_stream,
-                                   g_object_ref (task),
-                                   NULL);
+  if (g_strcmp0 (type, "jpeg") == 0)
+    {
+      gdk_pixbuf_save_to_stream_async (pixbuf,
+                                       G_OUTPUT_STREAM (stream),
+                                       type,
+                                       cancellable,
+                                       photos_base_item_save_save_to_stream,
+                                       g_object_ref (task),
+                                       "quality", "90",
+                                       NULL);
+    }
+  else
+    {
+      gdk_pixbuf_save_to_stream_async (pixbuf,
+                                       G_OUTPUT_STREAM (stream),
+                                       type,
+                                       cancellable,
+                                       photos_base_item_save_save_to_stream,
+                                       g_object_ref (task),
+                                       NULL);
+    }
 
  out:
   g_clear_object (&pixbuf);


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