close(fi);
fi = open(filename, O_WRONLY|O_BINARY|O_TRUNC|O_CREAT, 0666);
if(fi>=0) {
- swf_WriteSWC(fi, &tmp);
+ swf_WriteSWF(fi, &tmp);
close(fi);
msg("v2swf_backpatch %s - fix header: success\n", filename);
}
return -1;
}
- if(swf->compressed) {
- if FAILED(swf_WriteSWC(fi,swf))
- msg("<error> WriteSWC() failed.\n");
- } else {
- if FAILED(swf_WriteSWF(fi,swf))
- msg("<error> WriteSWF() failed.\n");
- }
+ if FAILED(swf_WriteSWF(fi,swf))
+ msg("<error> WriteSWF() failed.\n");
if(filename)
close(fi);
if(fi<0) {
fprintf(stderr, "couldn't create output file %s", outfilename);
}
- if(swf.compressed)
- {if(swf_WriteSWC(fi, &swf)<0) fprintf(stderr, "WriteSWC() failed.\n");}
- else
- {if(swf_WriteSWF(fi, &swf)<0) fprintf(stderr, "WriteSWF() failed.\n");}
+ if(swf_WriteSWF(fi, &swf)<0)
+ fprintf(stderr, "WriteSWF() failed.\n");
close(fi);
tag = swf_InsertTag(tag, ST_END);
int fi = open("black.swf", O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if(swf_WriteSWC(fi,&swf)<0) {
+ if(swf_WriteSWF(fi,&swf)<0) {
fprintf(stderr,"WriteSWF() failed.\n");
}
close(fi);
tag = swf_InsertTag(tag, ST_END);
fi = open("video3.swf", O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if(swf_WriteSWC(fi,&swf)<0) {
+ if(swf_WriteSWF(fi,&swf)<0) {
fprintf(stderr,"WriteSWF() failed.\n");
}
close(fi);
PyErr_SetString(PyExc_Exception, setError("couldn't create output file %s", filename));
return 0;
}
- if(swf->compressed) {
- if(swf_WriteSWC(fi, swf)<0) {
- close(fi);
- PyErr_SetString(PyExc_Exception, setError("WriteSWC() failed."));
- return 0;
- }
- } else {
- if(swf_WriteSWF(fi, swf)<0) {
- close(fi);
- PyErr_SetString(PyExc_Exception, setError("WriteSWC() failed."));
- return 0;
- }
+ if(swf_WriteSWF(fi, swf)<0) {
+ close(fi);
+ PyErr_SetString(PyExc_Exception, setError("WriteSWC() failed."));
+ return 0;
}
close(fi);
/* -*- mode: c; tab-width: 4; -*- ---------------------------[for (x)emacs]--
- $Id: gif2swf.c,v 1.6 2007/01/13 17:26:47 kramm Exp $
+ $Id: gif2swf.c,v 1.7 2008/03/12 19:13:31 kramm Exp $
GIF to SWF converter tool
Part of the swftools package.
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);
}
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 (swf_WriteSWF(handle, swf)<0)
+ fprintf(stderr, "Unable to write output file: %s\n", sname);
if (handle != so)
close(handle);
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);
}
}
if(do_cgi)
{if(swf_WriteCGI(swf)<0) syntaxerror("WriteCGI() failed.\n");}
- else if(swf->compressed)
- {if(swf_WriteSWC(fi, swf)<0) syntaxerror("WriteSWC() failed.\n");}
else
{if(swf_WriteSWF(fi, swf)<0) syntaxerror("WriteSWF() failed.\n");}
if(config.zlib) {
if(newswf.fileVersion < 6)
newswf.fileVersion = 6;
- swf_WriteSWC(fi, &newswf);
+ newswf.compressed = 1;
+ swf_WriteSWF(fi, &newswf);
} else {
- newswf.compressed = 0;
+ newswf.compressed = -1; // don't compress
swf_WriteSWF(fi, &newswf);
}
close(fi);