/* maximum width of encoding */
#define ENC_MAX_LEN 8192
+#define NUM_OF_SCANLINES 1
typedef enum {
MM_UTIL_JPEG_FILE,
int i = 0;
int y = 0;
while (dinfo.output_scanline < dinfo.output_height) {
- jpeg_read_scanlines(&dinfo, buffer, 1);
- if (dinfo.err->msg_code != 0) {
- mm_util_error("jpeg_read_scanlines failed");
+ if (jpeg_read_scanlines(&dinfo, buffer, NUM_OF_SCANLINES) != NUM_OF_SCANLINES) {
+ mm_util_error("jpeg_read_scanlines failed (msg_code: %d)", dinfo.err->msg_code);
ret = MM_UTIL_ERROR_INVALID_OPERATION;
goto END;
}
int state = 0;
while (dinfo.output_scanline < dinfo.output_height) {
/* jpeg_read_scanlines expects an array of pointers to scanlines. Here the array is only one element long, but you could ask formore than one scanline at a time if that's more convenient. */
- jpeg_read_scanlines(&dinfo, buffer, 1);
- if (dinfo.err->msg_code != 0) {
- mm_util_error("jpeg_read_scanlines failed");
+ if (jpeg_read_scanlines(&dinfo, buffer, NUM_OF_SCANLINES) != NUM_OF_SCANLINES) {
+ mm_util_error("jpeg_read_scanlines failed (msg_code: %d)", dinfo.err->msg_code);
ret = MM_UTIL_ERROR_INVALID_OPERATION;
goto END;
}