# HG changeset patch
# User Edouard Gomez <[EMAIL PROTECTED]>
# Date 1186441752 -7200
# Node ID 365b6446df07dca8d7db5433c6a89b2be663f095
# Parent 5ee260a0a3f94cb7cce3b0827abec26cd232f2ff
wb: fix 8bit photos workflow
This patch fixes major problems in the 8bit photo workflows:
- Auto White balance was applied all the time which results in bad
white balance most of the time. For 8bit photos, it's moslty sure
the in camera DSP applied its own white balance, so it's no use
to force an auto white balance, just use neutral white balance settings.
- 8bit photos were not marked active, thus the settings were never saved, and
it was just impossible to work on multpiple 8bit photos at the same time.
It was mandatory to work on a single photo, export then work on a second
photo
- Curve Cache loading doesn't work realiably if text nodes are inserted
in the xml cache file.
All this problems were spotted while working on 8bit photos.
diff -r 5ee260a0a3f9 -r 365b6446df07 src/gtk-interface.c
--- a/src/gtk-interface.c Tue Aug 14 14:37:01 2007 +0000
+++ b/src/gtk-interface.c Tue Aug 07 01:09:12 2007 +0200
@@ -364,20 +364,20 @@ icon_activated(gpointer instance, const
{
if (rs->photo->metadata->cam_mul[R] == -1.0)
{
- rs->photo->current_setting = 2;
+ rs->current_setting = 2;
rs_set_wb_auto(rs);
- rs->photo->current_setting = 1;
+ rs->current_setting = 1;
rs_set_wb_auto(rs);
- rs->photo->current_setting = 0;
+ rs->current_setting = 0;
rs_set_wb_auto(rs);
}
else
{
- rs->photo->current_setting = 2;
+ rs->current_setting = 2;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
- rs->photo->current_setting = 1;
+ rs->current_setting = 1;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
- rs->photo->current_setting = 0;
+ rs->current_setting = 0;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
}
if (rs->photo->metadata->contrast != -1.0)
diff -r 5ee260a0a3f9 -r 365b6446df07 src/rawstudio.c
--- a/src/rawstudio.c Tue Aug 14 14:37:01 2007 +0000
+++ b/src/rawstudio.c Tue Aug 07 01:09:12 2007 +0200
@@ -1007,7 +1007,7 @@ rs_photo_open_dcraw(const gchar *filenam
if (!dcraw_open(raw, (char *) filename))
{
dcraw_load_raw(raw);
- photo = rs_photo_new(NULL);
+ photo = rs_photo_new();
photo->input = rs_image16_new(raw->raw.width, raw->raw.height,
4, 4);
rs_photo_open_dcraw_apply_black_and_shift(raw, photo);
@@ -1201,6 +1201,16 @@ rs_photo_open_gdk(const gchar *filename)
}
g_object_unref(pixbuf);
photo->filename = g_strdup(filename);
+
+ /* Force white balance to neutral one, 8bit pics have been
+ * white balanced by the camera digital picture processor */
+ photo->metadata->cam_mul[R] = 1.0f;
+ photo->metadata->cam_mul[G] = 1.0f;
+ photo->metadata->cam_mul[B] = 1.0f;
+ photo->metadata->cam_mul[G2] = 1.0f;
+
+ /* Mark it active */
+ photo->active = TRUE;
}
return(photo);
}
@@ -1326,6 +1336,7 @@ skip_block:
skip_block:
continue;
}
+ memset(pre_mul, 0, sizeof(pre_mul));
for(c=0;c<4;c++)
if (dsum[c])
pre_mul[c] = dsum[c+4] / dsum[c];
diff -r 5ee260a0a3f9 -r 365b6446df07 src/rs-cache.c
--- a/src/rs-cache.c Tue Aug 14 14:37:01 2007 +0000
+++ b/src/rs-cache.c Tue Aug 07 01:09:12 2007 +0200
@@ -58,6 +58,7 @@ rs_cache_save(RS_PHOTO *photo)
cachename = rs_cache_get_name(photo->filename);
if (!cachename) return;
writer = xmlNewTextWriterFilename(cachename, 0); /* fixme, check for
errors */
+ xmlTextWriterSetIndent(writer, 1);
xmlTextWriterStartDocument(writer, NULL, "ISO-8859-1", NULL);
xmlTextWriterStartElement(writer, BAD_CAST "rawstudio-cache");
xmlTextWriterWriteFormatElement(writer, BAD_CAST "priority", "%d",
@@ -156,13 +157,13 @@ rs_cache_load_setting(RS_SETTINGS_DOUBLE
y = atof((gchar *) vals[1]);
rss->curve_knots[rss->curve_nknots*2+0] = x;
rss->curve_knots[rss->curve_nknots*2+1] = y;
+ rss->curve_nknots++;
+ num--;
}
g_strfreev(vals);
xmlFree(val);
}
curve = curve->next;
- rss->curve_nknots++;
- if (rss->curve_nknots > num) break;
}
}
_______________________________________________
Rawstudio-dev mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev