diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 18:10:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 18:10:19 +0300 |
commit | 06a1a66a9b6f120867d3bbebe3928744ec8e3495 (patch) | |
tree | 42e827a3cf58eb76474e479206b02a8d97dd3bf7 /source/blender/imbuf/intern/jpeg.c | |
parent | 61d27db35967710421ab92748e09624db068258d (diff) | |
parent | a24b4e6090057479796e914bc603119b12f6ca06 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/imbuf/intern/jpeg.c')
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index ef9217fbc8c..2febbb1f861 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -48,7 +48,7 @@ #include "IMB_imbuf.h" #include "IMB_metadata.h" #include "IMB_filetype.h" -#include "jpeglib.h" +#include "jpeglib.h" #include "jerror.h" #include "IMB_colormanagement.h" @@ -247,12 +247,12 @@ static boolean handle_app1(j_decompress_ptr cinfo) INT32 length; /* initialized by the macro */ INT32 i; char neogeo[128]; - + INPUT_VARS(cinfo); INPUT_2BYTES(cinfo, length, return false); length -= 2; - + if (length < 16) { for (i = 0; i < length; i++) { INPUT_BYTE(cinfo, neogeo[i], return false); @@ -308,12 +308,12 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int fla row_stride = cinfo->output_width * depth; row_pointer = (*cinfo->mem->alloc_sarray)((j_common_ptr) cinfo, JPOOL_IMAGE, row_stride, 1); - + for (y = ibuf->y - 1; y >= 0; y--) { jpeg_read_scanlines(cinfo, row_pointer, 1); rect = (uchar *) (ibuf->rect + y * ibuf->x); buffer = row_pointer[0]; - + switch (depth) { case 1: for (x = ibuf->x; x > 0; x--) { @@ -419,7 +419,7 @@ next_stamp_marker: jpeg_finish_decompress(cinfo); } - + jpeg_destroy((j_common_ptr) cinfo); if (ibuf) { ibuf->ftype = IMB_FTYPE_JPG; @@ -456,7 +456,7 @@ ImBuf *imb_load_jpeg(const unsigned char *buffer, size_t size, int flags, char c memory_source(cinfo, buffer, size); ibuf = ibJpegImageFromCinfo(cinfo, flags); - + return(ibuf); } @@ -584,7 +584,7 @@ static int init_jpeg(FILE *outfile, struct jpeg_compress_struct *cinfo, struct I break; } jpeg_set_defaults(cinfo); - + /* own settings */ cinfo->dct_method = JDCT_FLOAT; @@ -629,7 +629,7 @@ static int save_stdjpeg(const char *name, struct ImBuf *ibuf) int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags) { - + ibuf->flags = flags; return save_stdjpeg(name, ibuf); } |