new parameter addspacechars
[swftools.git] / src / jpeg2swf.c
index 7c1298f..9981a15 100644 (file)
@@ -136,13 +136,11 @@ int MovieFinish(SWF * swf, TAG * t, char *sname)
            sname = "output.swf";
        handle = open(sname, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
     }
-    if(global.version >= 6) {
-       if (swf_WriteSWC(handle, swf)<0) 
-               fprintf(stderr, "Unable to write output file: %s\n", sname);
-    } else {
-       if (swf_WriteSWF(handle, swf)<0) 
-               fprintf(stderr, "Unable to write output file: %s\n", sname);
+    if(handle<0 && sname) {
+        perror(sname);
     }
+    if (swf_WriteSWF(handle, swf)<0) 
+        fprintf(stderr, "Unable to write output file: %s\n", sname);
 
     if (handle != so)
        close(handle);
@@ -548,6 +546,7 @@ static struct options_t options[] = {
 {"y", "yoffset"},
 {"X", "width"},
 {"Y", "height"},
+{"T", "flashversion"},
 {"v", "verbose"},
 {"V", "version"},
 {"f", "fit-to-movie"},
@@ -595,6 +594,7 @@ void args_callback_usage(char *name)
     printf("-y , --yoffset <offset>        vertically offset images by <offset>\n");
     printf("-X , --width <width>           Force movie width to <width> (default: autodetect)\n");
     printf("-Y , --height <height>         Force movie height to <height> (default: autodetect)\n");
+    printf("-T , --flashversion <version>      Set flash file version to <version>\n");
     printf("-v , --verbose <level>         Set verbose level to <level> (0=quiet, 1=default, 2=debug)\n");
     printf("-V , --version                 Print version information and exit\n");
     printf("-f , --fit-to-movie            Fit images to movie size\n");
@@ -632,7 +632,7 @@ int main(int argc, char **argv)
        int i;
        for (i = 0; i < global.nfiles; i++) {
            if (VERBOSE(3))
-               fprintf(stderr, "[%03i] %s (%i%%, 1/%i)\n", i,
+               fprintf(stderr, "[%03i] %s (%i%%)\n", i,
                        image[i].filename, image[i].quality);
            t = MovieAddFrame(&swf, t, image[i].filename, image[i].quality,
                              image[i].width, image[i].height);