From 2f3b3e39f92d65ea7d4b5e74205fb2df1e6b9b09 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 13 Jun 2014 15:12:54 -0400 Subject: [PATCH] fixed utGallery bugs --- openbr/plugins/gallery.cpp | 8 ++++---- openbr/plugins/misc.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 1c6b560..547a922 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -199,7 +199,7 @@ class utGallery : public BinaryGallery while (bytesNeeded > 0) { qint64 bytesRead = gallery.read(dst, bytesNeeded); if (bytesRead <= 0) - qFatal("Unexepected EOF when reading universal template data."); + qFatal("Unexepected EOF when reading universal template data, needed: %d more bytes.", bytesNeeded); bytesNeeded -= bytesRead; dst += bytesRead; } @@ -224,7 +224,7 @@ class utGallery : public BinaryGallery if (t.empty()) return; - const QByteArray imageID = t.file.get("ImageID"); + const QByteArray imageID = QByteArray::fromHex(t.file.get("ImageID")); if (imageID.size() != 16) qFatal("Expected 16-byte ImageID, got: %d bytes.", imageID.size()); @@ -239,8 +239,8 @@ class utGallery : public BinaryGallery const QByteArray templateID = QCryptographicHash::hash(data, QCryptographicHash::Md5); const uint32_t size = data.size(); - gallery.write(QByteArray::fromHex(imageID)); - gallery.write(QByteArray::fromHex(templateID)); + gallery.write(imageID); + gallery.write(templateID); gallery.write((const char*) &algorithmID, 4); gallery.write((const char*) &size, 4); gallery.write(data); diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 0951262..bc97735 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -150,7 +150,7 @@ private: dst += (mode == Encoded) ? encoded : decoded; } - dst.file.set("ImageID", QVariant(QCryptographicHash::hash(data, QCryptographicHash::Md5))); + dst.file.set("ImageID", QVariant(QCryptographicHash::hash(data, QCryptographicHash::Md5).toHex())); dst.file.set("AlgorithmID", mode == Decoded ? 5 : 3); } }; -- libgit2 0.21.4