From 8e8d8190b115b73719537e0b24d524894b3c8961 Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 3 Nov 2002 09:53:42 +0000 Subject: [PATCH] fixed grayscale bug --- src/jpeg2swf.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/jpeg2swf.c b/src/jpeg2swf.c index 3d5e54c..a9a413c 100644 --- a/src/jpeg2swf.c +++ b/src/jpeg2swf.c @@ -109,14 +109,30 @@ TAG * MovieAddFrame(SWF * swf,TAG * t,char * sname,int quality,int scale,int id) out = swf_SetJPEGBitsStart(t,cinfo.output_width,cinfo.output_height,quality); scanline = (U8*)malloc(4*cinfo.output_width); - + + // the following code is a duplication of swf_SetJPEGBits in ../lib/modules/swfbits.c if (scanline) { int y; U8 * js = scanline; - for (y=0;y=0;x--) { + js[x*3] = js[x*3+1] = js[x*3+2] = js[x]; + } + swf_SetJPEGBitsLines(out,(U8**)&js,1); + } + } + else if(cinfo.out_color_space == JCS_RGB) + { + for (y=0;y