added auto-choose of image format when transparency is present

This commit is contained in:
csoler 2023-01-16 22:11:44 +01:00
parent de1b8f08d2
commit 7aacfb9aef
6 changed files with 47 additions and 23 deletions

View file

@ -34,6 +34,7 @@ public:
static void extractImage(QWidget *window, QTextCursor cursor, QString file = "");
static bool optimizeSizeHtml(QString &html, const QImage& original, QImage &optimized, int maxPixels = -1, int maxBytes = -1);
static bool optimizeSizeBytes(QByteArray &bytearray, const QImage &original, QImage &optimized, const char *format, int maxPixels, int maxBytes);
static bool hasAlphaContent(const QImage& image);
private:
static int checkSize(QByteArray& embeddedImage, const QImage& img, const char *format);