diff options
author | John Hawthorn <jhawthor@uvic.ca> | 2008-09-13 00:02:38 -0700 |
---|---|---|
committer | John Hawthorn <jhawthor@uvic.ca> | 2008-09-13 00:02:38 -0700 |
commit | d9e9f33c3210b71c07c4268415ff9b1555819b3f (patch) | |
tree | 1574715591b8ae6cb08771ff19670b56a5c887a9 /src/png.c | |
parent | 219d3d9d9c17db046755327054be8061bdb2bb7a (diff) | |
download | mirror-meh-d9e9f33c3210b71c07c4268415ff9b1555819b3f.tar.gz mirror-meh-d9e9f33c3210b71c07c4268415ff9b1555819b3f.tar.bz2 mirror-meh-d9e9f33c3210b71c07c4268415ff9b1555819b3f.zip |
Major changes. Optional XShm support, bilinear scaling, caching WIP
Diffstat (limited to 'src/png.c')
-rw-r--r-- | src/png.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -54,8 +54,8 @@ struct image *png_open(FILE *f){ png_read_info(p->png_ptr, p->info_ptr); - p->img.width = png_get_image_width(p->png_ptr, p->info_ptr); - p->img.height = png_get_image_height(p->png_ptr, p->info_ptr); + p->img.bufwidth = png_get_image_width(p->png_ptr, p->info_ptr); + p->img.bufheight = png_get_image_height(p->png_ptr, p->info_ptr); return (struct image *)p; } @@ -91,9 +91,9 @@ int png_read(struct image *img){ png_read_update_info(p->png_ptr, p->info_ptr); } - row_pointers = (png_bytepp)malloc(img->height * sizeof(png_bytep)); - for(y = 0; y < img->height; y++) - row_pointers[y] = img->buf + y * img->width * 3; + row_pointers = (png_bytepp)malloc(img->bufheight * sizeof(png_bytep)); + for(y = 0; y < img->bufheight; y++) + row_pointers[y] = img->buf + y * img->bufwidth * 3; png_read_image(p->png_ptr, row_pointers); free(row_pointers); |