[Rawstudio-commit] r3502 - trunk/plugins/meta-tiff

Klaus Post klauspost at gmail.com
Sat Aug 21 14:41:31 CEST 2010


Author: post
Date: 2010-08-21 14:41:31 +0200 (Sat, 21 Aug 2010)
New Revision: 3502

Modified:
   trunk/plugins/meta-tiff/tiff-meta.c
Log:
Don't allow WB information to be overwritten by private makernote data when parsing DNG files. In rare cases, like Canon sRAW, it might have changed due to conversion.

Modified: trunk/plugins/meta-tiff/tiff-meta.c
===================================================================
--- trunk/plugins/meta-tiff/tiff-meta.c	2010-08-20 18:51:34 UTC (rev 3501)
+++ trunk/plugins/meta-tiff/tiff-meta.c	2010-08-21 12:41:31 UTC (rev 3502)
@@ -1195,7 +1195,7 @@
 exif_reader(RAWFILE *rawfile, guint offset, RSMetadata *meta)
 {
 	gushort number_of_entries = 0;
-
+	
 	struct IFD ifd;
 
 	/* get number of entries */
@@ -1337,6 +1337,9 @@
 	RAWFILE *maker_raw = raw_create_from_memory(maker_data, org_offset + org_size, org_offset, byteorder);
 
 	/* Read makernote, as if this was the original file */
+	/* We preserve WB since it might have changed - converted Canon sRAW for instance */
+	gdouble stored_mul[4];
+	memcpy(stored_mul, meta->cam_mul,4*sizeof(gdouble));
 	switch (meta->make)
 	{
 		case MAKE_CANON:
@@ -1363,7 +1366,8 @@
 		default:
 			break;
 	}
-
+	/* Restore WB */
+	memcpy(meta->cam_mul, stored_mul, 4*sizeof(gdouble));
 	raw_close_file(maker_raw);
 	g_free(maker_data);
 	raw_set_byteorder(rawfile, tiff_byteorder);




More information about the Rawstudio-commit mailing list