unsigned int w,
unsigned int h,
unsigned int row_stride);
-static void *
+static int
eet_data_image_jpeg_alpha_decode(const void *data,
int size,
unsigned int src_x,
return 1;
}
-static void *
+static int
eet_data_image_jpeg_alpha_decode(const void *data,
int size,
unsigned int src_x,
unsigned int x, y, l, scans;
unsigned int i, iw;
+ /* FIXME: handle src_x, src_y and row_stride correctly */
+ if (!d)
+ return 0;
+
memset(&cinfo, 0, sizeof (struct jpeg_decompress_struct));
cinfo.err = jpeg_std_error(&(jerr.pub));
jerr.pub.emit_message = _JPEGErrorHandler2;
jerr.pub.output_message = _JPEGErrorHandler;
if (setjmp(jerr.setjmp_buffer))
- return NULL;
+ return 0;
jpeg_create_decompress(&cinfo);
if (eet_jpeg_membuf_src(&cinfo, data, (size_t)size))
{
jpeg_destroy_decompress(&cinfo);
- return NULL;
+ return 0;
}
jpeg_read_header(&cinfo, TRUE);
cinfo.src = NULL;
jpeg_destroy_decompress(&cinfo);
- return NULL;
+ return 0;
}
/* end head decoding */
cinfo.src = NULL;
jpeg_destroy_decompress(&cinfo);
- return NULL;
+ return 0;
}
tdata = alloca(w * 16 * 3);
ptr2 = d;
+
if (cinfo.output_components == 1)
{
for (i = 0; i < (unsigned int)cinfo.rec_outbuf_height; i++)
/* end data decoding */
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
- return d;
+ return 1;
}
static void *