mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
avif: warn about non-recommended libavif configuration
This commit is contained in:
parent
d9729b7190
commit
8732fc8487
@ -446,6 +446,16 @@ bool QAVIFHandler::write(const QImage &image)
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *encoder_name = avifCodecName(AVIF_CODEC_CHOICE_AUTO, AVIF_CODEC_FLAG_CAN_ENCODE);
|
||||
if (!encoder_name) {
|
||||
qWarning("Cannot save AVIF images because libavif was built without AV1 encoders!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_quality >= 100 && !avifCodecName(AVIF_CODEC_CHOICE_AOM, AVIF_CODEC_FLAG_CAN_ENCODE)) {
|
||||
qWarning("You are using %s encoder. It is recommended to enable libAOM encoder in libavif for better near-lossless compression.", encoder_name);
|
||||
}
|
||||
|
||||
int maxQuantizer = AVIF_QUANTIZER_WORST_QUALITY * (100 - qBound(0, m_quality, 100)) / 100;
|
||||
int minQuantizer = 0;
|
||||
int maxQuantizerAlpha = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user