}}
#define checkval255(v) { \
- if(v<254 && !(v==217 && i==0 && j==21)) { \
+ if(v<254) { \
printf("\nComp. %s at %d,%d should be 255, not %d\n", #v, i, j, v); \
retval=0; goto bailout; \
}}
}
*size=yuvsize;
cinfo->next_scanline+=height;
+ jpeg_abort_compress(&j->cinfo);
}
else
{
jpeg_write_scanlines(&j->cinfo, &row_pointer[j->cinfo.next_scanline],
j->cinfo.image_height-j->cinfo.next_scanline);
}
- }
- jpeg_finish_compress(&j->cinfo);
- if(!(flags&TJ_YUV))
+ jpeg_finish_compress(&j->cinfo);
*size=TJBUFSIZE(j->cinfo.image_width, j->cinfo.image_height)
-(unsigned long)(j->jdms.free_in_buffer);
+ }
bailout:
if(j->cinfo.global_state>CSTATE_START) jpeg_abort_compress(&j->cinfo);