Author: post
Date: 2010-07-04 12:19:57 +0200 (Sun, 04 Jul 2010)
New Revision: 3461
Modified:
trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp
Log:
Rawspeed: First try to load camera definition file from configuration dir, this
allows easy user-updates of camera definitions.
Modified: trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp
===================================================================
--- trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp 2010-07-01
20:20:32 UTC (rev 3460)
+++ trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp 2010-07-04
10:19:57 UTC (rev 3461)
@@ -36,13 +36,23 @@
static CameraMetaData *c = NULL;
if (!c)
{
- gchar *path = g_build_filename(PACKAGE_DATA_DIR,
"rawspeed/cameras.xml", NULL);
- try {
- c = new CameraMetaData(path);
- } catch (CameraMetadataException e) {
- printf("RawSpeed: Could not open camera metadata
information.\n%s\nRawSpeed will not be used!\n", e.what());
- return rs_filter_response_new();
- }
+ gchar *path;
+ path = g_strdup_printf("%s/cameras.xml", rs_confdir_get());
+ FILE *fp = fopen(path,"r");
+ if (!fp)
+ {
+ g_free(path);
+ path = g_build_filename(PACKAGE_DATA_DIR,
"rawspeed/cameras.xml", NULL);
+ }
+ else
+ printf("RawSpeed: Using custom camera metadata
information at %s.\n", path);
+
+ try {
+ c = new CameraMetaData(path);
+ } catch (CameraMetadataException e) {
+ printf("RawSpeed: Could not open camera metadata
information.\n%s\nRawSpeed will not be used!\n", e.what());
+ return rs_filter_response_new();
+ }
g_free(path);
}
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit