mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
use Z_BEST_SPEED as default quality for PNG images
same as level 1 which is used in rcc, for reference: https://www.zlib.net/manual.html Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7b6793612e
commit
42413708fd
1 changed files with 5 additions and 2 deletions
|
@ -29,11 +29,14 @@
|
||||||
#include "qvector.h"
|
#include "qvector.h"
|
||||||
#include "qdrawhelper_p.h"
|
#include "qdrawhelper_p.h"
|
||||||
|
|
||||||
|
#include <zlib.h>
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
#include <pngconf.h>
|
#include <pngconf.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
enum { QPNGDefaultQuality = Z_BEST_SPEED };
|
||||||
|
|
||||||
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||||
# define QFILLER_ORDER PNG_FILLER_BEFORE
|
# define QFILLER_ORDER PNG_FILLER_BEFORE
|
||||||
#else
|
#else
|
||||||
|
@ -58,7 +61,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
QPngHandlerPrivate(QPngHandler *qq)
|
QPngHandlerPrivate(QPngHandler *qq)
|
||||||
: gamma(0.0), quality(2), png_ptr(0), info_ptr(0),
|
: gamma(0.0), quality(QPNGDefaultQuality), png_ptr(0), info_ptr(0),
|
||||||
end_info(0), row_pointers(0), state(Ready), q(qq)
|
end_info(0), row_pointers(0), state(Ready), q(qq)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -679,7 +682,7 @@ bool QPngHandler::write(const QImage &image)
|
||||||
quality = qMin(quality, 100);
|
quality = qMin(quality, 100);
|
||||||
quality = (100-quality) * 9 / 91; // map [0,100] -> [9,0]
|
quality = (100-quality) * 9 / 91; // map [0,100] -> [9,0]
|
||||||
} else {
|
} else {
|
||||||
quality = 2;
|
quality = QPNGDefaultQuality;
|
||||||
}
|
}
|
||||||
writer.setGamma(d->gamma);
|
writer.setGamma(d->gamma);
|
||||||
return writer.writeImage(image, quality);
|
return writer.writeImage(image, quality);
|
||||||
|
|
Loading…
Add table
Reference in a new issue