Add support for Jasper 3.x.

This resolves issue #4.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit d9d028f1e2)
r14.0.x r14.0.12
Slávek Banko 3 years ago
parent 3344fc9a64
commit cd6707c1d2
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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;

Loading…
Cancel
Save