Author: abrander
Date: 2009-12-31 02:53:55 +0100 (Thu, 31 Dec 2009)
New Revision: 2942

Modified:
   branches/rawstudio-ng-color/src/rs-cache.c
Log:
Added save and restore of DCP-profile selection.

Modified: branches/rawstudio-ng-color/src/rs-cache.c
===================================================================
--- branches/rawstudio-ng-color/src/rs-cache.c  2009-12-31 01:52:20 UTC (rev 
2941)
+++ branches/rawstudio-ng-color/src/rs-cache.c  2009-12-31 01:53:55 UTC (rev 
2942)
@@ -76,6 +76,12 @@
                photo->orientation);
        xmlTextWriterWriteFormatElement(writer, BAD_CAST "angle", "%f",
                photo->angle);
+
+       RSDcpFile *dcp = rs_photo_get_dcp_profile(photo);
+       if (RS_IS_DCP_FILE(dcp))
+               xmlTextWriterWriteFormatElement(writer, BAD_CAST "dcp-profile", 
"%s",
+                       rs_tiff_get_filename(RS_TIFF(dcp)));
+
        if (photo->crop)
        {
                xmlTextWriterWriteFormatElement(writer, BAD_CAST "crop", "%d %d 
%d %d",
@@ -374,6 +380,15 @@
                                photo->exported = TRUE;
                        xmlFree(val);
                }
+               else if ((!xmlStrcmp(cur->name, BAD_CAST "dcp-profile")))
+               {
+                       val = xmlNodeListGetString(doc, cur->xmlChildrenNode, 
1);
+                       RSDcpFactory *factory = rs_dcp_factory_new_default();
+                       RSDcpFile *dcp = rs_dcp_factory_find_from_path(factory, 
(gchar *) val);
+                       if (dcp)
+                               rs_photo_set_dcp_profile(photo, dcp);
+                       xmlFree(val);
+               }
                else if ((!xmlStrcmp(cur->name, BAD_CAST "crop")))
                {
                        RS_RECT *crop = g_new0(RS_RECT, 1);


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

Reply via email to