fixed two bugs in font2swf
[swftools.git] / src / png2swf.c
index 0878543..9afdc46 100644 (file)
@@ -100,13 +100,8 @@ int MovieFinish(SWF * swf, TAG * t, char *sname)
     if(global.do_cgi) {
        if FAILED(swf_WriteCGI(swf)) fprintf(stderr,"WriteCGI() failed.\n");
     } else {
-       if(global.version >= 6) {
-           if (swf_WriteSWC(f, swf)<0) 
-                   fprintf(stderr, "Unable to write output file: %s\n", sname);
-       } else {
-           if (swf_WriteSWF(f, swf)<0) 
-                   fprintf(stderr, "Unable to write output file: %s\n", sname);
-       }
+        if (swf_WriteSWF(f, swf)<0) 
+            fprintf(stderr, "Unable to write output file: %s\n", sname);
        if (f != so)
            close(f);
     }
@@ -756,7 +751,14 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id)
 
     int width=0, height=0;
 
+#ifndef HAVE_JPEGLIB
+    if(global.mkjpeg) {
+        global.mkjpeg = 0;
+        msg("<warning> No jpeg support compiled in");
+    }
+#endif
     if(global.mkjpeg) {
+#ifdef HAVE_JPEGLIB
        RGBA*data = 0;
        getPNG(sname, &width, &height, (unsigned char**)&data);
        if(!data) 
@@ -770,6 +772,7 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id)
            swf_SetU16(t, id);
            swf_SetJPEGBits2(t, width,height,data,global.mkjpeg);
        }
+#endif
     } else if(1) {
        RGBA*data = 0;
        getPNG(sname, &width, &height, (unsigned char**)&data);
@@ -1064,7 +1067,7 @@ void args_callback_usage(char *name)
     printf("-q , --quiet                   Omit normal log messages, only log errors\n");
     printf("-C , --cgi                     For use as CGI- prepend http header, write to stdout\n");
     printf("-V , --version                 Print version information and exit\n");
-    printf("-s , --scale <percent>         Scale image to <percent>%% size.\n");
+    printf("-s , --scale <percent>         Scale image to <percent>% size.\n");
     printf("\n");
 }