mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-11-03 00:18:47 -05:00
EXR: support for lossy HTJ2K quality introduced in OpenEXR 3.5
This commit is contained in:
committed by
Mirco Miranda
parent
59157971e8
commit
487b51ae9c
@@ -774,9 +774,16 @@ bool EXRHandler::write(const QImage &image)
|
||||
// set the DCT quality (used by DCT compressions only)
|
||||
if (m_quality > -1 && m_quality <= 100) {
|
||||
header.dwaCompressionLevel() = float(m_quality);
|
||||
#if QT_VERSION_CHECK(OPENEXR_VERSION_MAJOR, OPENEXR_VERSION_MINOR, OPENEXR_VERSION_PATCH) >= QT_VERSION_CHECK(3, 5, 0)
|
||||
header.lossyHTJ2KQuality() = float(m_quality) * 1.5f; // Lossy J2K max quality is 150
|
||||
#endif
|
||||
}
|
||||
// make ZIP compression fast (used by ZIP compressions)
|
||||
header.zipCompressionLevel() = 1;
|
||||
#if QT_VERSION_CHECK(OPENEXR_VERSION_MAJOR, OPENEXR_VERSION_MINOR, OPENEXR_VERSION_PATCH) >= QT_VERSION_CHECK(3, 5, 0)
|
||||
// make ZSTD compression fast (used by ZSTD compressions)
|
||||
header.zstdCompressionLevel() = 1; // default is 5 -> 1 is faster
|
||||
#endif
|
||||
|
||||
// set preview (don't set it for small images)
|
||||
if (width > 1024 || height > 1024) {
|
||||
|
||||
Reference in New Issue
Block a user