[gnome-photos/wip/rishi/misc-fixes: 22/22] base-item: Save JPEGs at quality=90



commit f4276daefcdcd42e7c19e8247cd37a3206086347
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 ee850a5..82e4499 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1082,13 +1082,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]