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