Commit 75673d8237d03e68ed668dc963925ec0382c7c44

Authored by Josh Klontz
1 parent cbe7e26c

added more diagnostics

Showing 1 changed file with 5 additions and 1 deletions
openbr/plugins/gallery.cpp
@@ -234,8 +234,10 @@ class utGallery : public BinaryGallery @@ -234,8 +234,10 @@ class utGallery : public BinaryGallery
234 qint64 bytesNeeded = ut.size; 234 qint64 bytesNeeded = ut.size;
235 while (bytesNeeded > 0) { 235 while (bytesNeeded > 0) {
236 qint64 bytesRead = gallery.read(dst, bytesNeeded); 236 qint64 bytesRead = gallery.read(dst, bytesNeeded);
237 - if (bytesRead <= 0) 237 + if (bytesRead <= 0) {
  238 + qDebug() << gallery.errorString();
238 qFatal("Unexepected EOF while reading universal template data, needed: %d more of: %d bytes.", int(bytesNeeded), int(ut.size)); 239 qFatal("Unexepected EOF while reading universal template data, needed: %d more of: %d bytes.", int(bytesNeeded), int(ut.size));
  240 + }
239 bytesNeeded -= bytesRead; 241 bytesNeeded -= bytesRead;
240 dst += bytesRead; 242 dst += bytesRead;
241 } 243 }
@@ -260,6 +262,8 @@ class utGallery : public BinaryGallery @@ -260,6 +262,8 @@ class utGallery : public BinaryGallery
260 t.file.set("ImageID", QVariant(QByteArray((const char*)ut.imageID, 16).toHex())); 262 t.file.set("ImageID", QVariant(QByteArray((const char*)ut.imageID, 16).toHex()));
261 t.file.set("TemplateID", QVariant(QByteArray((const char*)ut.templateID, 16).toHex())); 263 t.file.set("TemplateID", QVariant(QByteArray((const char*)ut.templateID, 16).toHex()));
262 t.file.set("AlgorithmID", ut.algorithmID); 264 t.file.set("AlgorithmID", ut.algorithmID);
  265 + } else {
  266 + qFatal("Failed to read universal template header!");
263 } 267 }
264 return t; 268 return t;
265 } 269 }