Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ Image::decodeJPEGBufferIntoMimeSurface(uint8_t *buf, unsigned len) {

jpeg_mem_src(&args, buf, len);

jpeg_read_header(&args, 1);
jpeg_read_header(&args, (boolean)1);
jpeg_start_decompress(&args);
width = naturalWidth = args.output_width;
height = naturalHeight = args.output_height;
Expand Down Expand Up @@ -1080,7 +1080,7 @@ Image::loadJPEGFromBuffer(uint8_t *buf, unsigned len) {

jpeg_mem_src(&args, buf, len);

jpeg_read_header(&args, 1);
jpeg_read_header(&args, (boolean)1);
jpeg_start_decompress(&args);
width = naturalWidth = args.output_width;
height = naturalHeight = args.output_height;
Expand Down Expand Up @@ -1129,7 +1129,7 @@ Image::loadJPEG(FILE *stream) {

jpeg_stdio_src(&args, stream);

jpeg_read_header(&args, 1);
jpeg_read_header(&args, (boolean)1);
jpeg_start_decompress(&args);

if (args.output_width > canvas_max_side || args.output_height > canvas_max_side) {
Expand Down
6 changes: 3 additions & 3 deletions src/JPEGStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ empty_closure_output_buffer(j_compress_ptr cinfo){
dest->buffer = (JOCTET *)malloc(dest->bufsize);
cinfo->dest->next_output_byte = dest->buffer;
cinfo->dest->free_in_buffer = dest->bufsize;
return true;
return (boolean)true;
}

void
Expand Down Expand Up @@ -93,12 +93,12 @@ void encode_jpeg(jpeg_compress_struct cinfo, cairo_surface_t *surface, int quali
jpeg_set_defaults(&cinfo);
if (progressive)
jpeg_simple_progression(&cinfo);
jpeg_set_quality(&cinfo, quality, (quality < 25) ? 0 : 1);
jpeg_set_quality(&cinfo, quality, (boolean)((quality < 25) ? 0 : 1));
cinfo.comp_info[0].h_samp_factor = chromaHSampFactor;
cinfo.comp_info[0].v_samp_factor = chromaVSampFactor;

JSAMPROW slr;
jpeg_start_compress(&cinfo, TRUE);
jpeg_start_compress(&cinfo, (boolean)TRUE);
unsigned char *dst;
unsigned int *src = (unsigned int *)cairo_image_surface_get_data(surface);
int sl = 0;
Expand Down