[Rawstudio-commit] r1884 - trunk/src

Anders Brander anders at brander.dk
Mon Jul 21 02:45:29 CEST 2008


Author: abrander
Date: 2008-07-21 02:45:28 +0200 (Mon, 21 Jul 2008)
New Revision: 1884

Modified:
   trunk/src/gtk-interface.c
   trunk/src/rawstudio.c
   trunk/src/rawstudio.h
   trunk/src/rs-actions.c
   trunk/src/rs-batch.c
Log:
Added rs_metadata_load().

Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c	2008-07-21 00:34:50 UTC (rev 1883)
+++ trunk/src/gtk-interface.c	2008-07-21 00:45:28 UTC (rev 1884)
@@ -196,9 +196,8 @@
 				return;
 			}
 
-			if (filetype->load_meta)
+			if (rs_metadata_load(name, photo->metadata))
 			{
-				filetype->load_meta(name, photo->metadata);
 				switch (photo->metadata->orientation)
 				{
 					case 90: ORIENTATION_90(photo->orientation);

Modified: trunk/src/rawstudio.c
===================================================================
--- trunk/src/rawstudio.c	2008-07-21 00:34:50 UTC (rev 1883)
+++ trunk/src/rawstudio.c	2008-07-21 00:45:28 UTC (rev 1884)
@@ -466,6 +466,28 @@
 	return;
 }
 
+/**
+ * Load metadata from file
+ */
+gboolean
+rs_metadata_load(const gchar *filename, RS_METADATA *metadata)
+{
+	gboolean ret = FALSE;
+	RS_FILETYPE *filetype;
+
+	g_assert(filename != NULL);
+
+	filetype = rs_filetype_get(filename, TRUE);
+
+	if (filetype && filetype->load_meta)
+	{
+		filetype->load_meta(filename, metadata);
+		ret = TRUE;
+	}
+
+	return ret;
+}
+
 void
 rs_metadata_normalize_wb(RS_METADATA *meta)
 {

Modified: trunk/src/rawstudio.h
===================================================================
--- trunk/src/rawstudio.h	2008-07-21 00:34:50 UTC (rev 1883)
+++ trunk/src/rawstudio.h	2008-07-21 00:45:28 UTC (rev 1884)
@@ -276,6 +276,7 @@
 void rs_settings_double_free(RS_SETTINGS_DOUBLE *rssd);
 RS_METADATA *rs_metadata_new();
 void rs_metadata_free(RS_METADATA *metadata);
+gboolean rs_metadata_load(const gchar *filename, RS_METADATA *metadata);
 void rs_metadata_normalize_wb(RS_METADATA *meta);
 RS_BLOB *rs_new();
 void rs_free(RS_BLOB *rs);

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c	2008-07-21 00:34:50 UTC (rev 1883)
+++ trunk/src/rs-actions.c	2008-07-21 00:45:28 UTC (rev 1884)
@@ -428,9 +428,8 @@
 				photo->filename = g_strdup(g_list_nth_data(selected, cur));
 				if ((filetype = rs_filetype_get(photo->filename, TRUE)))
 				{
-					if (filetype->load_meta)
+					if (rs_metadata_load(photo->filename, photo->metadata))
 					{
-						filetype->load_meta(photo->filename, photo->metadata);
 						switch (photo->metadata->orientation)
 						{
 							case 90: ORIENTATION_90(photo->orientation);

Modified: trunk/src/rs-batch.c
===================================================================
--- trunk/src/rs-batch.c	2008-07-21 00:34:50 UTC (rev 1883)
+++ trunk/src/rs-batch.c	2008-07-21 00:45:28 UTC (rev 1884)
@@ -487,8 +487,7 @@
 			rs_image16_demosaic(photo->input, RS_DEMOSAIC_PPG);
 			if (photo)
 			{
-				if (filetype->load_meta)
-					filetype->load_meta(filename_in, photo->metadata);
+				rs_metadata_load(filename_in, photo->metadata);
 				filename = g_string_new(queue->directory);
 				g_string_append(filename, G_DIR_SEPARATOR_S);
 				g_string_append(filename, queue->filename);




More information about the Rawstudio-commit mailing list