Add support for Jasper 3.x.

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

@ -279,7 +279,16 @@ kimgio_jp2_write( TQImageIO* io )
TQTextStream ts( &rate, IO_WriteOnly );
ts << "rate="
<< ( (io->quality() < 0) ? DEFAULT_RATE : io->quality() / 100.0F );
# if defined(JAS_VERSION_MAJOR) && (JAS_VERSION_MAJOR >= 3)
const jas_image_fmtinfo_t *jp2_fmtinfo = jas_image_lookupfmtbyname("jp2");
int i = -1;
if (jp2_fmtinfo)
{
i = jas_image_encode(ji, stream, jp2_fmtinfo->id, rate.utf8().data());
}
# else
int i = jp2_encode( ji, stream, rate.utf8().data() );
# endif
jas_image_destroy( ji );
jas_stream_close( stream );

Loading…
Cancel
Save