}
{
dst->data_cb = (unsigned char *)malloc(dst->h1 * dstride1);
- memcpy(dst->data_cb, img->data_cb, dst->h0 * dstride0);
+ memcpy(dst->data_cb, img->data_cb, dst->h1 * dstride1);
}
{
- dst->data_cr = (unsigned char *)malloc(dst->h1 * dstride1);
- memcpy(dst->data_cr, img->data_cr, dst->h0 * dstride0);
+ dst->data_cr = (unsigned char *)malloc(dst->h2 * dstride2);
+ memcpy(dst->data_cr, img->data_cr, dst->h2 * dstride2);
}
return dst;
cinfo.input_components = 3;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, jpeg_quality, FALSE);
+
+ if (jpeg_mode == PROGRESSIVE) {
+ jpeg_simple_progression(&cinfo);
+ }
+
cinfo.image_width = img->width;
cinfo.image_height = img->height;
cinfo.raw_data_in = TRUE;