X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fswfc.c;h=1be48cc2236c085557f4f928b0a90cf04dbc1679;hp=1c7e0d90203dad614f40058a68f6d149b52a2503;hb=22f4b2fb5eab04dff324b61eeef8cb3f0c99dc69;hpb=f7555c9f25b9008e1996e029f83ebeaaafd95321 diff --git a/src/swfc.c b/src/swfc.c index 1c7e0d9..1be48cc 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -776,22 +776,30 @@ void s_image(char*name, char*type, char*filename, int quality) s_box(name, 0, 0, black, 20, 0); return; } - tag = swf_InsertTag(tag, ST_DEFINEBITSJPEG2); - swf_SetU16(tag, imageID); + if(type=="jpeg") { +#ifndef HAVE_LIBJPEG + warning("no jpeg support compiled in"); + s_box(name, 0, 0, black, 20, 0); + return; +#else + tag = swf_InsertTag(tag, ST_DEFINEBITSJPEG2); + swf_SetU16(tag, imageID); - if(swf_SetJPEGBits(tag, filename, quality) < 0) { - syntaxerror("Image \"%s\" not found, or contains errors", filename); - } + if(swf_SetJPEGBits(tag, filename, quality) < 0) { + syntaxerror("Image \"%s\" not found, or contains errors", filename); + } - swf_GetJPEGSize(filename, &width, &height); + swf_GetJPEGSize(filename, &width, &height); - r.xmin = 0; - r.ymin = 0; - r.xmax = width*20; - r.ymax = height*20; + r.xmin = 0; + r.ymin = 0; + r.xmax = width*20; + r.ymax = height*20; - s_addimage(name, id, tag, r); - incrementid(); + s_addimage(name, id, tag, r); + incrementid(); +#endif + } /* step 2: the character */ tag = swf_InsertTag(tag, ST_DEFINESHAPE); // todo: should be defineshape2/3 once images can be transparent.(?) @@ -2313,6 +2321,7 @@ static void parseArgumentsForCommand(char*command) map_t args; int nr = -1; msg(" parse Command: %s (line %d)", command, line); + for(t=0;t