Author: post
Date: 2011-12-29 20:14:08 +0100 (Thu, 29 Dec 2011)
New Revision: 4072

Modified:
   trunk/librawstudio/rs-metadata.c
   trunk/librawstudio/rs-metadata.h
Log:
Add exposure bias to metadata fields (by Erik Wognsen)

Modified: trunk/librawstudio/rs-metadata.c
===================================================================
--- trunk/librawstudio/rs-metadata.c    2011-12-29 18:55:55 UTC (rev 4071)
+++ trunk/librawstudio/rs-metadata.c    2011-12-29 19:14:08 UTC (rev 4072)
@@ -82,6 +82,7 @@
        metadata->timestamp = -1;
        metadata->orientation = 0;
        metadata->aperture = -1.0;
+       metadata->exposurebias = -999.0;
        metadata->iso = 0;
        metadata->shutterspeed = -1.0;
        metadata->thumbnail_start = 0;
@@ -157,6 +158,8 @@
                xmlTextWriterWriteFormatElement(writer, BAD_CAST "orientation", 
"%u", metadata->orientation);
                if (metadata->aperture > -1.0)
                        xmlTextWriterWriteFormatElement(writer, BAD_CAST 
"aperture", "%f", metadata->aperture);
+               if (metadata->exposurebias != -999.0)
+                       xmlTextWriterWriteFormatElement(writer, BAD_CAST 
"exposurebias", "%f", metadata->exposurebias);
                if (metadata->iso > 0)
                        xmlTextWriterWriteFormatElement(writer, BAD_CAST "iso", 
"%u", metadata->iso);
                if (metadata->shutterspeed > -1.0)
@@ -286,6 +289,12 @@
                                metadata->aperture = rs_atof((gchar *) val);
                                xmlFree(val);
                        }
+                       else if ((!xmlStrcmp(cur->name, BAD_CAST 
"exposurebias")))
+                       {
+                               val = xmlNodeListGetString(doc, 
cur->xmlChildrenNode, 1);
+                               metadata->exposurebias = rs_atof((gchar *) val);
+                               xmlFree(val);
+                       }
                        else if ((!xmlStrcmp(cur->name, BAD_CAST "iso")))
                        {
                                val = xmlNodeListGetString(doc, 
cur->xmlChildrenNode, 1);
@@ -540,6 +549,8 @@
                g_string_append_printf(label, _("1/%.0fs "), 
metadata->shutterspeed);
        if (metadata->aperture!=0.0)
                g_string_append_printf(label, _("F/%.1f "), metadata->aperture);
+       if (metadata->exposurebias>-999.0)
+               g_string_append_printf(label, _("%+.1fEV "), 
metadata->exposurebias);
        if (metadata->iso!=0)
                g_string_append_printf(label, _("ISO%d"), metadata->iso);
 

Modified: trunk/librawstudio/rs-metadata.h
===================================================================
--- trunk/librawstudio/rs-metadata.h    2011-12-29 18:55:55 UTC (rev 4071)
+++ trunk/librawstudio/rs-metadata.h    2011-12-29 19:14:08 UTC (rev 4072)
@@ -64,6 +64,7 @@
        GTime timestamp;
        gushort orientation;
        gfloat aperture;
+       gfloat exposurebias;
        gushort iso;
        gfloat shutterspeed;
        guint thumbnail_start;


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

Reply via email to