From: DRC Date: Tue, 1 Mar 2011 08:18:30 +0000 (+0000) Subject: Don't call jpeg_finish_compress() with YUV output, because it tries to insert an... X-Git-Tag: 1.1.1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ee54594591d0ae958b81adc8ba3cacde522e5e3;p=libjpeg-turbo Don't call jpeg_finish_compress() with YUV output, because it tries to insert an EOI marker right in the middle of our image data. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@475 632fc199-4ca6-4c93-a231-07263d6284db --- diff --git a/ChangeLog.txt b/ChangeLog.txt index 4f0dc72..fb92532 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,10 @@ +1.1.1 +===== + +[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated +by tjEncodeYUV(). + + 1.1.0 ===== diff --git a/jpegut.c b/jpegut.c index 1be8bc1..3bbcb89 100644 --- a/jpegut.c +++ b/jpegut.c @@ -219,7 +219,7 @@ int checkbuf(unsigned char *buf, int w, int h, int ps, int subsamp, int flags) }} #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; \ }} diff --git a/turbojpegl.c b/turbojpegl.c index 8e3f2b0..5cc5437 100644 --- a/turbojpegl.c +++ b/turbojpegl.c @@ -300,6 +300,7 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h, } *size=yuvsize; cinfo->next_scanline+=height; + jpeg_abort_compress(&j->cinfo); } else { @@ -315,11 +316,10 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h, 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);