mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
fix regression since 51f2253d73
png_read_image() handles interlacing internally Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e4e8ff4b26
commit
2098340301
1 changed files with 5 additions and 3 deletions
|
@ -140,7 +140,7 @@ bool QPngHandler::read(QImage *image)
|
|||
int bit_depth;
|
||||
int color_type;
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
|
||||
png_set_interlace_handling(png_ptr);
|
||||
const int passes = png_set_interlace_handling(png_ptr);
|
||||
|
||||
if (bit_depth == 16) {
|
||||
png_set_strip_16(png_ptr);
|
||||
|
@ -181,8 +181,10 @@ bool QPngHandler::read(QImage *image)
|
|||
|
||||
uchar *data = image->d->data;
|
||||
const int bpl = image->bytesPerLine();
|
||||
for (uint y = 0; y < height; y++) {
|
||||
png_read_row(png_ptr, QFAST_SCAN_LINE(data, bpl, y), NULL);
|
||||
for (int p = 0; p < passes; p++) {
|
||||
for (uint y = 0; y < height; y++) {
|
||||
png_read_row(png_ptr, QFAST_SCAN_LINE(data, bpl, y), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
image->d->dpmx = png_get_x_pixels_per_meter(png_ptr, info_ptr);
|
||||
|
|
Loading…
Add table
Reference in a new issue