X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=cff2c9f625a725b64f1cf8c1e4d9b4047b090604;hb=5058b5848c87ff41a3d83d163cef448989bd7726;hp=0fb7c2259165e55ab9292b772fa8fa6985917850;hpb=e029c9c4c2ee6b4d944a7c46bd39d35d4aa56213;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 0fb7c22..cff2c9f 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -157,9 +157,18 @@ int swf_SetJPEGBits(TAG * t,char * fname,int quality) } else if(cinfo.out_color_space == JCS_YCbCr) { - //FIXME - fprintf(stderr, "Error: Can't convert YCbCr(YUV) to RGB.\n"); - return -1; + for (y=0;y>8); + js[x*3+1] = y - ((88*(u-128)-183*(v-128))>>8); + js[x*3+2] = y + ((455 * (u-128))>>8); + } + } } else if(cinfo.out_color_space == JCS_CMYK) { @@ -243,7 +252,7 @@ int swf_SetLosslessBits(TAG * t,U16 width,U16 height,void * bitmap,U8 bitmap_fla swf_SetU16(t,width); swf_SetU16(t,height); - if (data=malloc(OUTBUFFER_SIZE)) + if ((data=malloc(OUTBUFFER_SIZE))) { z_stream zs; memset(&zs,0x00,sizeof(z_stream)); @@ -289,7 +298,7 @@ int swf_SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * p swf_SetU16(t,height); swf_SetU8(t,ncolors-1); // number of pal entries - if (data=malloc(OUTBUFFER_SIZE)) + if ((data=malloc(OUTBUFFER_SIZE))) { z_stream zs; memset(&zs,0x00,sizeof(z_stream)); @@ -298,7 +307,7 @@ int swf_SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * p if (deflateInit(&zs,Z_DEFAULT_COMPRESSION)==Z_OK) { U8 * zpal; // compress palette - if (zpal = malloc(ncolors*4)) + if ((zpal = malloc(ncolors*4))) { U8 * pp = zpal; int i;