Author: post
Date: 2009-11-09 20:05:39 +0100 (Mon, 09 Nov 2009)
New Revision: 167

Modified:
   RawSpeed/rawstudio-plugin-api.cpp
Log:
- Only display a warning when the camera file cannot be found.
- Include black/white scale in timing.
- Nicer error messages. ;)

Modified: RawSpeed/rawstudio-plugin-api.cpp
===================================================================
--- RawSpeed/rawstudio-plugin-api.cpp   2009-11-03 16:59:55 UTC (rev 166)
+++ RawSpeed/rawstudio-plugin-api.cpp   2009-11-09 19:05:39 UTC (rev 167)
@@ -40,7 +40,12 @@
        if (!c)
        {
                gchar *path = g_build_filename(rs_confdir_get(), "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 NULL;
+       }
                g_free(path);
        }
 
@@ -65,7 +70,7 @@
                }
 
 #ifdef TIME_LOAD
-               printf("Open %s: %.03fs\n", filename, g_timer_elapsed(gt, 
NULL));
+               printf("RawSpeed Open %s: %.03fs\n", filename, 
g_timer_elapsed(gt, NULL));
                g_timer_destroy(gt);
 #endif
 
@@ -85,24 +90,24 @@
                        d->decodeRaw();
                        d->decodeMetaData(c);
 
-#ifdef TIME_LOAD
-                       printf("Decode %s: %.03fs\n", filename, 
g_timer_elapsed(gt, NULL));
-                       g_timer_destroy(gt);
-#endif
-
                        for (guint i = 0; i < d->errors.size(); i++)
-                               printf("Error Encountered:%s\n", d->errors[i]);
+                               printf("RawSpeed: Error Encountered:%s\n", 
d->errors[i]);
 
                        RawImage r = d->mRaw;
       r->scaleBlackWhite();
 
+#ifdef TIME_LOAD
+         printf("RawSpeed Decode %s: %.03fs\n", filename, g_timer_elapsed(gt, 
NULL));
+      g_timer_destroy(gt);
+#endif
+
                        cpp = r->getCpp();
                        if (cpp == 1) 
                                image = rs_image16_new(r->dim.x, r->dim.y, cpp, 
cpp);
                        else if (cpp == 3) 
                                image = rs_image16_new(r->dim.x, r->dim.y, 3, 
4);
                        else {
-                               printf("Unsupported component per pixel count");
+                               printf("RawSpeed: Unsupported component per 
pixel count\n");
                                return NULL;
                        }
 
@@ -110,12 +115,6 @@
                                image->filters = r->cfa.getDcrawFilter();
 
 
-                       if (r->isCFA) 
-                       {
-//                             printf("DCRAW 
filter:%x\n",r->cfa.getDcrawFilter());
-//                             printf("%s", r->cfa.asString().c_str());
-                       }
-
       if (cpp == 1) 
       {
         BitBlt((guchar *)(GET_PIXEL(image,0,0)),image->pitch*2,
@@ -138,12 +137,12 @@
                }
                catch (RawDecoderException e)
                {
-                       printf("RawDecoderException: %s\n", e.what());
+                       printf("RawSpeed: RawDecoderException: %s\n", e.what());
                }
        }
        catch (TiffParserException e)
        {
-               printf("TiffParserException: %s\n", e.what());
+               printf("RawSpeed: TiffParserException: %s\n", e.what());
        }
 
        if (d) delete d;


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

Reply via email to