X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=svrt.git;a=blobdiff_plain;f=rgb_image.cc;h=f9b01c4bb8f5c446351e38abcc1160c54825be5e;hp=f803363ca7637e1200bf427d547db189cfb26f1c;hb=HEAD;hpb=194e1b60502426108c6f6c3cf2e08e95e7a2811d
diff --git a/rgb_image.cc b/rgb_image.cc
index f803363..f9b01c4 100644
--- a/rgb_image.cc
+++ b/rgb_image.cc
@@ -18,7 +18,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with selector. If not, see .
+ * along with svrt. If not, see .
*
*/
@@ -145,13 +145,13 @@ void RGBImage::read_png(const char *name) {
png_set_sig_bytes(png_ptr, header_size);
png_read_info(png_ptr, info_ptr);
- _width = info_ptr->width;
- _height = info_ptr->height;
+ _width = png_get_image_width(png_ptr, info_ptr);
+ _height = png_get_image_height(png_ptr, info_ptr);
png_byte bit_depth, color_type, channels;
- color_type = info_ptr->color_type;
- bit_depth = info_ptr->bit_depth;
- channels = info_ptr->channels;
+ color_type = png_get_color_type(png_ptr, info_ptr);
+ bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+ channels = png_get_channels(png_ptr, info_ptr);
if(bit_depth != 8) {
cerr << "Can only read 8-bits PNG images." << endl;
@@ -161,7 +161,7 @@ void RGBImage::read_png(const char *name) {
// allocate image pointer
row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * _height);
for (int y = 0; y < _height; y++)
- row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes);
+ row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr));
allocate();
@@ -266,7 +266,7 @@ void RGBImage::write_png(const char *name) {
// allocate memory
row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * _height);
for (int y = 0; y < _height; y++)
- row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes);
+ row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr));
int k;
for (int y = 0; y < _height; y++) {