diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-02-13 19:45:03 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-02-13 19:45:03 +0000 |
| commit | 15f7f4ab0f89e7881d1249dab00b716045bcdf42 (patch) | |
| tree | 81f70360f94f2b7993f3b01e3f8b11aa4dbdd837 /src | |
| parent | 5e7368087004da802d042b9ee2922c9a623cc7d4 (diff) | |
More informative errors when opj_start_compress fails.
Diffstat (limited to 'src')
| -rw-r--r-- | src/j2k.cc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -301,7 +301,12 @@ dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame opj_stream_set_user_data (stream, buffer, write_free_function); if (!opj_start_compress (encoder, xyz->opj_image(), stream)) { - throw MiscError ("could not start JPEG2000 encoding"); + if ((errno & 0x61500) == 0x61500) { + /* We've had one of the magic error codes from our patched openjpeg */ + throw MiscError (String::compose ("could not start JPEG2000 encoding (%1)", errno & 0xff)); + } else { + throw MiscError ("could not start JPEG2000 encoding"); + } } if (!opj_encode (encoder, stream)) { |
