From 75673d8237d03e68ed668dc963925ec0382c7c44 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Mon, 21 Jul 2014 12:24:16 -0400 Subject: [PATCH] added more diagnostics --- openbr/plugins/gallery.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index ac3253e..b1e40d3 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -234,8 +234,10 @@ class utGallery : public BinaryGallery qint64 bytesNeeded = ut.size; while (bytesNeeded > 0) { qint64 bytesRead = gallery.read(dst, bytesNeeded); - if (bytesRead <= 0) + if (bytesRead <= 0) { + qDebug() << gallery.errorString(); qFatal("Unexepected EOF while reading universal template data, needed: %d more of: %d bytes.", int(bytesNeeded), int(ut.size)); + } bytesNeeded -= bytesRead; dst += bytesRead; } @@ -260,6 +262,8 @@ class utGallery : public BinaryGallery t.file.set("ImageID", QVariant(QByteArray((const char*)ut.imageID, 16).toHex())); t.file.set("TemplateID", QVariant(QByteArray((const char*)ut.templateID, 16).toHex())); t.file.set("AlgorithmID", ut.algorithmID); + } else { + qFatal("Failed to read universal template header!"); } return t; } -- libgit2 0.21.4