Commit a13f9edb6f9421e5dbf4c6661e9adb556bdebc85

Authored by Josh Klontz
1 parent 0dbc7e42

fixes

.gitignore
@@ -24,5 +24,5 @@ build* @@ -24,5 +24,5 @@ build*
24 ### Subversion ### 24 ### Subversion ###
25 *.svn* 25 *.svn*
26 26
27 -### Synology ###  
28 -*.DS* 27 +### OS X ###
  28 +*.DS_Store
1 -Subproject commit 37d044f7dc669a2a14317ba8e82e59a4fc4d22f7 1 +Subproject commit 3501de8f90e2ec366ea418c7d5d2ef8beb612e73
sdk/plugins/format.cpp
@@ -215,13 +215,23 @@ class DefaultFormat : public Format @@ -215,13 +215,23 @@ class DefaultFormat : public Format
215 if (m.data) t.append(m); 215 if (m.data) t.append(m);
216 #endif // BR_EMBEDDED 216 #endif // BR_EMBEDDED
217 } else { 217 } else {
218 - QString prefix = "";  
219 - if (!QFileInfo(file.name).exists()) prefix = file.getString("path") + "/";  
220 - Mat m = imread((prefix+file.name).toStdString()); 218 + QString fileName = file.name;
  219 + if (!QFileInfo(fileName).exists()) {
  220 + fileName = file.getString("path") + "/" + file.name;
  221 + if (!QFileInfo(fileName).exists()) {
  222 + fileName = file.fileName();
  223 + if (!QFileInfo(fileName).exists()) {
  224 + fileName = file.getString("path") + "/" + file.fileName();
  225 + qDebug() << fileName;
  226 + if (!QFileInfo(fileName).exists()) return t;
  227 + }
  228 + }
  229 + }
  230 +
  231 + Mat m = imread(fileName.toStdString());
221 if (m.data) { 232 if (m.data) {
222 t.append(m); 233 t.append(m);
223 - }  
224 - else { 234 + } else {
225 videoFormat videoReader; 235 videoFormat videoReader;
226 videoReader.file = file; 236 videoReader.file = file;
227 t = videoReader.read(); 237 t = videoReader.read();
sdk/plugins/gallery.cpp
@@ -130,7 +130,7 @@ class EmptyGallery : public Gallery @@ -130,7 +130,7 @@ class EmptyGallery : public Gallery
130 QMutexLocker diskLocker(&diskLock); 130 QMutexLocker diskLocker(&diskLock);
131 const QString destination = file.name + "/" + t.file.baseName() + postfix + ".png"; 131 const QString destination = file.name + "/" + t.file.baseName() + postfix + ".png";
132 if (!cache || !QFileInfo(destination).exists()) { 132 if (!cache || !QFileInfo(destination).exists()) {
133 - if (t.isNull()) QFile::copy(t.file.name, destination); 133 + if (t.isNull()) QFile::copy((t.file.exists() ? QString() : Globals->path+"/") + t.file.name, destination);
134 else OpenCVUtils::saveImage(t, destination); 134 else OpenCVUtils::saveImage(t, destination);
135 } 135 }
136 } 136 }
@@ -439,7 +439,8 @@ class xmlGallery : public Gallery @@ -439,7 +439,8 @@ class xmlGallery : public Gallery
439 439
440 ~xmlGallery() 440 ~xmlGallery()
441 { 441 {
442 - BEE::writeSigset(file, files, ignoreMetadata); 442 + if (!files.isEmpty())
  443 + BEE::writeSigset(file, files, ignoreMetadata);
443 } 444 }
444 445
445 TemplateList readBlock(bool *done) 446 TemplateList readBlock(bool *done)