diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-04-27 17:16:35 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-04-29 00:48:33 +0200 |
commit | d9d028f1e239546736bd4303133b180fc037d1a2 (patch) | |
tree | 1b94e8cd5aadbdac2cd602674893abc834669844 | |
parent | cfa478f5194af0533b39a5f584fc384ca903d2ae (diff) | |
download | digikam-d9d028f1e239546736bd4303133b180fc037d1a2.tar.gz digikam-d9d028f1e239546736bd4303133b180fc037d1a2.zip |
Add support for Jasper 3.x.
This resolves issue #4.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | digikam/libs/dimg/loaders/jp2kloader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/digikam/libs/dimg/loaders/jp2kloader.cpp b/digikam/libs/dimg/loaders/jp2kloader.cpp index 1035391..66351c2 100644 --- a/digikam/libs/dimg/loaders/jp2kloader.cpp +++ b/digikam/libs/dimg/loaders/jp2kloader.cpp @@ -660,7 +660,17 @@ bool JP2KLoader::save(const TQString& filePath, DImgLoaderObserver *observer) DDebug() << "JPEG2000 quality: " << quality << endl; DDebug() << "JPEG2000 " << rate << endl; +# if defined(JAS_VERSION_MAJOR) && (JAS_VERSION_MAJOR >= 3) + const jas_image_fmtinfo_t *jp2_fmtinfo = jas_image_lookupfmtbyname("jp2"); + int ret = -1; + if (jp2_fmtinfo) + { + ret = jas_image_encode(jp2_image, jp2_stream, jp2_fmtinfo->id, rate.utf8().data()); + } +# else int ret = jp2_encode(jp2_image, jp2_stream, rate.utf8().data()); +# endif + if (ret != 0) { DDebug() << "Unable to encode JPEG2000 image" << endl; |