Check primaries returned from libavif

Due to various double vs float arithmetic,
some primaries could be rejected by Qt.
If necessary, we adjust the values so they
will be accepted by Qt.

Remove newline from the ends of error strings.
This commit is contained in:
Daniel Novomesky
2021-02-27 19:11:56 +01:00
parent ca52d4ddf5
commit 1462c3abd6
2 changed files with 35 additions and 19 deletions

View File

@ -14,6 +14,7 @@
#include <qimageiohandler.h>
#include <QImageIOPlugin>
#include <QByteArray>
#include <QPointF>
#include <avif/avif.h>
class QAVIFHandler : public QImageIOHandler
@ -41,6 +42,7 @@ public:
int loopCount() const override;
private:
static QPointF CompatibleChromacity(qreal chrX, qreal chrY);
bool ensureParsed() const;
bool ensureDecoder();
bool decode_one_frame();