Commit 72bbd4e7 authored by Debarshi Ray's avatar Debarshi Ray

base-item: Save everything other than PNGs as JPEGs

This is a reasonable strategy to start with. It let's us avoid writing
size guessing code for every possible image format out there. Apart
from RAW images, PNGs and JPEGs are the most common formats out there,
and JPEG is a good option for exporting RAWs.

We can add support for more formats as we go along.
parent 5dac3e90
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2014, 2015 Pranav Kant
* Copyright © 2012, 2013, 2014, 2015 Red Hat, Inc.
* Copyright © 2012, 2013, 2014, 2015, 2016 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -2153,7 +2153,7 @@ photos_base_item_save_async (PhotosBaseItem *self,
GeglBuffer *buffer;
GeglNode *graph;
PhotosBaseItemSaveData *data;
gchar *type = NULL;
const gchar *type;
g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
priv = self->priv;
......@@ -2166,8 +2166,10 @@ photos_base_item_save_async (PhotosBaseItem *self,
g_return_if_fail (priv->processor != NULL);
g_return_if_fail (!gegl_processor_work (priv->processor, NULL));
type = photos_utils_get_pixbuf_type_from_mime_type (priv->mime_type);
g_return_if_fail (type != NULL);
if (g_strcmp0 (priv->mime_type, "image/png") == 0)
type = "png";
else
type = "jpeg";
data = photos_base_item_save_data_new (dir, type);
......@@ -2183,7 +2185,6 @@ photos_base_item_save_async (PhotosBaseItem *self,
photos_base_item_save_buffer_zoom,
g_object_ref (task));
g_free (type);
g_object_unref (buffer);
g_object_unref (task);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment