diff --git a/.gitignore b/.gitignore index 7977fc1..8bcf4f9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,5 @@ build* ### Subversion ### *.svn* -### Synology ### -*.DS* +### OS X ### +*.DS_Store diff --git a/data b/data index 37d044f..3501de8 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 37d044f7dc669a2a14317ba8e82e59a4fc4d22f7 +Subproject commit 3501de8f90e2ec366ea418c7d5d2ef8beb612e73 diff --git a/sdk/plugins/format.cpp b/sdk/plugins/format.cpp index a12b9ff..58fc2d6 100644 --- a/sdk/plugins/format.cpp +++ b/sdk/plugins/format.cpp @@ -215,13 +215,23 @@ class DefaultFormat : public Format if (m.data) t.append(m); #endif // BR_EMBEDDED } else { - QString prefix = ""; - if (!QFileInfo(file.name).exists()) prefix = file.getString("path") + "/"; - Mat m = imread((prefix+file.name).toStdString()); + QString fileName = file.name; + if (!QFileInfo(fileName).exists()) { + fileName = file.getString("path") + "/" + file.name; + if (!QFileInfo(fileName).exists()) { + fileName = file.fileName(); + if (!QFileInfo(fileName).exists()) { + fileName = file.getString("path") + "/" + file.fileName(); + qDebug() << fileName; + if (!QFileInfo(fileName).exists()) return t; + } + } + } + + Mat m = imread(fileName.toStdString()); if (m.data) { t.append(m); - } - else { + } else { videoFormat videoReader; videoReader.file = file; t = videoReader.read(); diff --git a/sdk/plugins/gallery.cpp b/sdk/plugins/gallery.cpp index 6e4849a..6638cb5 100644 --- a/sdk/plugins/gallery.cpp +++ b/sdk/plugins/gallery.cpp @@ -130,7 +130,7 @@ class EmptyGallery : public Gallery QMutexLocker diskLocker(&diskLock); const QString destination = file.name + "/" + t.file.baseName() + postfix + ".png"; if (!cache || !QFileInfo(destination).exists()) { - if (t.isNull()) QFile::copy(t.file.name, destination); + if (t.isNull()) QFile::copy((t.file.exists() ? QString() : Globals->path+"/") + t.file.name, destination); else OpenCVUtils::saveImage(t, destination); } } @@ -439,7 +439,8 @@ class xmlGallery : public Gallery ~xmlGallery() { - BEE::writeSigset(file, files, ignoreMetadata); + if (!files.isEmpty()) + BEE::writeSigset(file, files, ignoreMetadata); } TemplateList readBlock(bool *done)