From acf47ae643e54c09e94f7fc904207d7ea6a24c22 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 7 May 2013 23:03:51 +0100 Subject: Better error on JPEG2000 decode failure. --- src/util.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 #include #include +#include #include #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 (size) + " bytes.")); } opj_cio_close (cio); -- cgit v1.2.3