summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-07 23:03:51 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-07 23:03:51 +0100
commitacf47ae643e54c09e94f7fc904207d7ea6a24c22 (patch)
tree2faf0e0f6c11bfac37edae12a0f90740417c5ebf /src
parent1368dfded40e5a774a73e2256e214bcaf4e74866 (diff)
Better error on JPEG2000 decode failure.
Diffstat (limited to 'src')
-rw-r--r--src/util.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc
index c66e63f5..6bee0dc7 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -26,6 +26,7 @@
#include <iostream>
#include <iomanip>
#include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
#include <openssl/sha.h>
#include "KM_util.h"
#include "KM_fileio.h"
@@ -41,6 +42,7 @@ using std::stringstream;
using std::min;
using std::max;
using boost::shared_ptr;
+using boost::lexical_cast;
using namespace libdcp;
/** Create a UUID.
@@ -187,7 +189,7 @@ libdcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
if (!image) {
opj_destroy_decompress (decoder);
opj_cio_close (cio);
- boost::throw_exception (DCPReadError ("could not decode JPEG2000 codestream"));
+ boost::throw_exception (DCPReadError ("could not decode JPEG2000 codestream of " + lexical_cast<string> (size) + " bytes."));
}
opj_cio_close (cio);