diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 10:38:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 10:38:07 +0400 |
commit | ab4a2aaf4a4b2b4e416aa1f113b30362cbe0dec3 (patch) | |
tree | 81af4c18519181490074508dbe9a8d515eab634f /source/blender/imbuf/intern/png.c | |
parent | 5a90ea77bc1333efe4e1e54984a080550ed3f707 (diff) |
style cleanup: follow style guide for formatting of if/for/while loops, and else if's
Diffstat (limited to 'source/blender/imbuf/intern/png.c')
-rw-r--r-- | source/blender/imbuf/intern/png.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 78c7c672e22..de935c7cc42 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -114,7 +114,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) compression= compression < 0 ? 0 : (compression > 9 ? 9 : compression); /* for prints */ - if(flags & IB_mem) + if (flags & IB_mem) name= "<memory>"; bytesperpixel = (ibuf->planes + 7) >> 3; @@ -256,7 +256,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) } - if(ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) { + if (ibuf->ppm[0] > 0.0 && ibuf->ppm[1] > 0.0) { png_set_pHYs(png_ptr, info_ptr, (unsigned int)(ibuf->ppm[0] + 0.5), (unsigned int)(ibuf->ppm[1] + 0.5), PNG_RESOLUTION_METER); } @@ -366,7 +366,8 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) png_set_palette_to_rgb(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { bytesperpixel = 4; - } else { + } + else { bytesperpixel = 3; } break; @@ -392,8 +393,8 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) int unit_type; png_uint_32 xres, yres; - if(png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type)) - if(unit_type == PNG_RESOLUTION_METER) { + if (png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type)) + if (unit_type == PNG_RESOLUTION_METER) { ibuf->ppm[0]= xres; ibuf->ppm[1]= yres; } @@ -470,7 +471,7 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) if (flags & IB_metadata) { png_text* text_chunks; int count = png_get_text(png_ptr, info_ptr, &text_chunks, NULL); - for(i = 0; i < count; i++) { + for (i = 0; i < count; i++) { IMB_metadata_add_field(ibuf, text_chunks[i].key, text_chunks[i].text); ibuf->flags |= IB_metadata; } |