diff --git a/openbr/core/bee.cpp b/openbr/core/bee.cpp index a429f92..dbc1f60 100644 --- a/openbr/core/bee.cpp +++ b/openbr/core/bee.cpp @@ -71,7 +71,11 @@ FileList BEE::readSigset(const File &sigset, bool ignoreMetadata) for (int i=0; i"); lines.append(""); foreach (const File &file, files) { - QStringList metadata; - if (!ignoreMetadata) { - foreach (const QString &key, file.localKeys()) { - if ((key == "Index") || (key == "Label") || (key == "Points") || (key == "Rects")) continue; - metadata.append(key+"=\""+QtUtils::toString(file.value(key))+"\""); - } - QStringList landmarks; - if (!file.points().isEmpty()) { - foreach (const QPointF &point, file.points()) landmarks.append(QtUtils::toString(point)); - metadata.append("Points=\"["+landmarks.join(",")+"]\""); landmarks.clear(); - } - if (!file.rects().isEmpty()) { - foreach (const QRectF &rect, file.rects()) landmarks.append(QtUtils::toString(rect)); - metadata.append("Rects=\"["+landmarks.join(",")+"]\""); + if (!file.isNull()) { + QStringList metadata; + if (!ignoreMetadata) { + foreach (const QString &key, file.localKeys()) { + if ((key == "Index") || (key == "Label") || (key == "Points") || (key == "Rects")) continue; + metadata.append(key+"=\""+QtUtils::toString(file.value(key))+"\""); + } + QStringList landmarks; + if (!file.points().isEmpty()) { + foreach (const QPointF &point, file.points()) landmarks.append(QtUtils::toString(point)); + metadata.append("Points=\"["+landmarks.join(",")+"]\""); landmarks.clear(); + } + if (!file.rects().isEmpty()) { + foreach (const QRectF &rect, file.rects()) landmarks.append(QtUtils::toString(rect)); + metadata.append("Rects=\"["+landmarks.join(",")+"]\""); + } } + lines.append("\t("Label",file.baseName()) +"\">"); + lines.append("\t\t"); + lines.append("\t"); } - lines.append("\t("Label",file.baseName()) +"\">"); - lines.append("\t\t"); - lines.append("\t"); } lines.append(""); QtUtils::writeFile(sigset, lines);