diff options
-rw-r--r-- | src/bmp.c | 2 | ||||
-rw-r--r-- | src/gif.c | 2 | ||||
-rw-r--r-- | src/jpeg.c | 2 | ||||
-rw-r--r-- | src/netpbm.c | 18 | ||||
-rw-r--r-- | src/png.c | 10 |
5 files changed, 17 insertions, 17 deletions
@@ -102,7 +102,7 @@ struct image *bmp_open(FILE *f){ b->rowwidth += 4 - (b->rowwidth & 3); } - b->img.fmt = &bmp; + b->img.fmt = &bmp; return (struct image *)b; } @@ -45,7 +45,7 @@ static struct image *gif_open(FILE *f){ g->img.bufwidth = gif->SWidth; g->img.bufheight = gif->SHeight; - g->img.fmt = &giflib; + g->img.fmt = &giflib; return (struct image *)g; } @@ -52,7 +52,7 @@ static struct image *jpeg_open(FILE *f){ j->jerr.pub.error_exit = error_exit; - j->img.fmt = &libjpeg; + j->img.fmt = &libjpeg; return (struct image *)j; } diff --git a/src/netpbm.c b/src/netpbm.c index dbd3d16..951bfd9 100644 --- a/src/netpbm.c +++ b/src/netpbm.c @@ -8,7 +8,7 @@ struct netpbm_t{ struct image img; FILE *f; - char format; + char format; unsigned int maxval; }; @@ -68,14 +68,14 @@ static unsigned char readvali(struct netpbm_t *b){ } static unsigned char readvalb(struct netpbm_t *b){ - if(b->maxval == 65535){ - int val = fgetc(b->f) << 8; - val |= fgetc(b->f); - return val * 255 / b->maxval; - }else{ - int val = fgetc(b->f); - return val * 255 / b->maxval; - } + if(b->maxval == 65535){ + int val = fgetc(b->f) << 8; + val |= fgetc(b->f); + return val * 255 / b->maxval; + }else{ + int val = fgetc(b->f); + return val * 255 / b->maxval; + } } int netpbm_read(struct image *img){ @@ -57,14 +57,14 @@ struct image *png_open(FILE *f){ 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); - p->img.fmt = &libpng; + p->img.fmt = &libpng; return (struct image *)p; } int png_read(struct image *img){ unsigned int y; - png_bytepp row_pointers; + png_bytepp row_pointers; struct png_t *p = (struct png_t *)img; if(setjmp(png_jmpbuf(p->png_ptr))){ @@ -93,11 +93,11 @@ int png_read(struct image *img){ png_read_update_info(p->png_ptr, p->info_ptr); } - row_pointers = (png_bytepp)malloc(img->bufheight * sizeof(png_bytep)); - for(y = 0; y < img->bufheight; y++) + 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); + png_read_image(p->png_ptr, row_pointers); free(row_pointers); img->state = LOADED; |