X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjpeg2swf.c;h=397721dbcba3ee41ee0ac2952f5379591a96d215;hb=77374b6b5505022a057dbab119854c6b4ad48916;hp=3d5e54cdf1fcbe3989eef7ed806f831765cb349d;hpb=dc4643c46a78e973154494161af6deabe75eae6e;p=swftools.git diff --git a/src/jpeg2swf.c b/src/jpeg2swf.c index 3d5e54c..397721d 100644 --- a/src/jpeg2swf.c +++ b/src/jpeg2swf.c @@ -65,7 +65,7 @@ int MovieFinish(SWF * swf,TAG * t,char * sname) if ((!isatty(so))&&(!sname)) handle = so; else { if (!sname) sname = "output.swf"; - handle = open(sname,O_RDWR|O_CREAT|O_TRUNC,0666); + handle = open(sname,O_BINARY|O_RDWR|O_CREAT|O_TRUNC,0666); } if FAILED(swf_WriteSWF(handle,swf)) if (VERBOSE(1)) fprintf(stderr,"Unable to write output file: %s\n",sname); if (handle!=so) close(handle); @@ -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