+}
+
+void PngLoader::load_pixels_(Image::Data &data)
+{
+ png_byte **rows = nullptr;
+
+ if(setjmp(png_jmpbuf(priv->png)))
+ {
+ delete[] rows;
+ throw bad_image_data(priv->message);
+ }
+
+ if(priv->interlace==PNG_INTERLACE_ADAM7)
+ {
+ // ADAM7 requires all rows to be loaded at once
+ unsigned n_passes = png_set_interlace_handling(priv->png);
+ rows = new png_byte *[data.height];
+ for(unsigned y=0; y<data.height; ++y)
+ rows[y] = reinterpret_cast<png_byte *>(data.pixels+data.stride*(data.height-1-y));