Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/hugin_base/panodata/SrcPanoImage.cpp [ac6687] .. [737323] Maximize Restore

  Switch to side-by-side view

--- a/src/hugin_base/panodata/SrcPanoImage.cpp
+++ b/src/hugin_base/panodata/SrcPanoImage.cpp
@@ -30,6 +30,7 @@
 // for debugging
 #include <iostream>
 #include <stdio.h>
+#include <stdexcept>
 //#include <wx/wxprec.h>
 
 #include "SrcPanoImage.h"
@@ -447,7 +448,7 @@
                     else
                     {
                         // tag is required
-                        throw;
+                        throw std::logic_error("Required tag CroppedAreaImageWidthPixels missing");
                     };
                     pos = xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaImageHeightPixels"));
                     if (pos != xmpData.end())
@@ -457,7 +458,7 @@
                     else
                     {
                         // tag is required
-                        throw;
+                        throw std::logic_error("Required tag CroppedAreaImageHeightPixels missing");
                     };
                     // check if sizes matches, if not ignore all tags
                     if (getWidth() == croppedWidth && getHeight() == croppedHeight)
@@ -471,7 +472,7 @@
                         else
                         {
                             // tag is required
-                            throw;
+                            throw std::logic_error("Required tag FullPanoWidthPixels missing");
                         };
                         long fullHeight = 0;
                         pos = xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.FullPanoHeightPixels"));
@@ -482,7 +483,7 @@
                         else
                         {
                             // tag is required
-                            throw;
+                            throw std::logic_error("Required tag FullPanoHeightPixels missing");
                         };
                         long cropTop = 0;
                         pos = xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaTopPixels"));
@@ -493,7 +494,7 @@
                         else
                         {
                             // tag is required
-                            throw;
+                            throw std::logic_error("Required tag CroppedAreaTopPixels missing");
                         };
 
                         // all found, remember for later
@@ -505,10 +506,10 @@
                 };
             };
         }
-        catch (...)
+        catch (std::exception e)
         {
             // just to catch error when image contains no GPano tags
-            DEBUG_DEBUG("Error when reading GPano tags");
+            std::cerr << "Error reading GPano tags from " << filename << "(" << e.what() << ")" << std::endl;
         };
     }