Commit 7eee335ba940f6cf0e42865aab5e843d4886ad99

Authored by Austin Blanton
1 parent 16b9bf50

Ignore imdecode problems

Showing 1 changed file with 7 additions and 2 deletions
openbr/plugins/misc.cpp
@@ -57,8 +57,13 @@ class OpenTransform : public UntrainableMetaTransform @@ -57,8 +57,13 @@ class OpenTransform : public UntrainableMetaTransform
57 } else { 57 } else {
58 // Propogate or decode existing matricies 58 // Propogate or decode existing matricies
59 foreach (const Mat &m, src) { 59 foreach (const Mat &m, src) {
60 - if (((m.rows > 1) && (m.cols > 1)) || (m.type() != CV_8UC1)) dst += m;  
61 - else dst += imdecode(src.m(), IMREAD_UNCHANGED); 60 + if (((m.rows > 1) && (m.cols > 1)) || (m.type() != CV_8UC1))
  61 + dst += m;
  62 + else {
  63 + Mat dec = imdecode(src.m(), IMREAD_UNCHANGED);
  64 + if (dec.empty()) qWarning("Can't decode %s", qPrintable(src.file.flat()));
  65 + else dst += dec;
  66 + }
62 } 67 }
63 } 68 }
64 } 69 }