diff options
Diffstat (limited to 'source/blender/imbuf/intern/jp2.c')
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index a70c154014a..c0f54898119 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -55,14 +55,14 @@ typedef struct img_folder{ float *rates; }img_fol_t; -static int checkj2p(unsigned char *mem) /* J2K_CFMT */ +static int check_jp2(unsigned char *mem) /* J2K_CFMT */ { return memcmp(JP2_HEAD, mem, 12) ? 0 : 1; } int imb_is_a_jp2(unsigned char *buf) { - return checkj2p(buf); + return check_jp2(buf); } @@ -95,9 +95,9 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) struct ImBuf *ibuf = 0; int use_float = 0; /* for precision higher then 8 use float */ - long signed_offsets[4] = {0,0,0,0}; - int float_divs[4]; - + long signed_offsets[4]= {0, 0, 0, 0}; + int float_divs[4]= {1, 1, 1, 1}; + int index; int w, h, depth; @@ -112,7 +112,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ opj_cio_t *cio = NULL; - if (checkj2p(mem) == 0) return(0); + if (check_jp2(mem) == 0) return(0); /* configure the event callbacks (not required) */ memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); @@ -189,7 +189,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) float_divs[i]= (1<<image->comps[i].prec)-1; } - ibuf= IMB_allocImBuf(w, h, depth, use_float ? IB_rectfloat : IB_rect, 0); + ibuf= IMB_allocImBuf(w, h, depth, use_float ? IB_rectfloat : IB_rect); if (ibuf==NULL) { if(dinfo) @@ -661,7 +661,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) { /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ -int imb_savejp2(struct ImBuf *ibuf, char *name, int flags) { +int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) { int quality = ibuf->ftype & 0xff; @@ -670,6 +670,8 @@ int imb_savejp2(struct ImBuf *ibuf, char *name, int flags) { opj_event_mgr_t event_mgr; /* event manager */ opj_image_t *image = NULL; + (void)flags; /* unused */ + /* configure the event callbacks (not required) setting of each callback is optionnal |