Author: akv
Date: 2009-07-19 15:59:47 +0200 (Sun, 19 Jul 2009)
New Revision: 2593

Modified:
   trunk/src/application.c
Log:
Fixed rs_photo_save().

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c     2009-07-19 12:24:35 UTC (rev 2592)
+++ trunk/src/application.c     2009-07-19 13:59:47 UTC (rev 2593)
@@ -116,6 +116,8 @@
 rs_photo_save(RS_PHOTO *photo, RSOutput *output, gint width, gint height, 
gboolean keep_aspect, gdouble scale, gint snapshot, RS_CMS *cms)
 {
        gfloat actual_scale;
+       RSIccProfile *profile = NULL;
+       gchar *profile_filename;
 
        g_assert(RS_IS_PHOTO(photo));
        g_assert(RS_IS_OUTPUT(output));
@@ -141,6 +143,30 @@
        g_object_set(fbasic_render, "settings", photo->settings[snapshot], 
NULL);
        g_object_set(fdenoise, "settings", photo->settings[snapshot], NULL);
 
+       /* Set input ICC profile */
+       profile_filename = rs_conf_get_cms_profile(CMS_PROFILE_INPUT);
+       if (profile_filename)
+       {
+               profile = rs_icc_profile_new_from_file(profile_filename);
+               g_free(profile_filename);
+       }
+       if (!profile)
+               profile = rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" 
PACKAGE "/profiles/generic_camera_profile.icc");
+       g_object_set(finput, "icc-profile", profile, NULL);
+       g_object_unref(profile);
+
+       /* Set output ICC profile */
+       profile_filename = rs_conf_get_cms_profile(CMS_PROFILE_EXPORT);
+       if (profile_filename)
+       {
+               profile = rs_icc_profile_new_from_file(profile_filename);
+               g_free(profile_filename);
+       }
+       if (!profile)
+               profile = rs_icc_profile_new_from_file(PACKAGE_DATA_DIR "/" 
PACKAGE "/profiles/sRGB.icc");
+       g_object_set(fbasic_render, "icc-profile", profile, NULL);
+       g_object_unref(profile);
+
        /* actually save */
        g_assert(rs_output_execute(output, fend));
 


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to