From: Matthias Kramm Date: Tue, 25 Aug 2009 17:14:30 +0000 (+0200) Subject: added gfx2gfx to Makefile, small fix in as3compile X-Git-Tag: version-0-9-1~289 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=70dd52c811db9f1a38a472a37135986accc4c06e added gfx2gfx to Makefile, small fix in as3compile --- diff --git a/src/Makefile.in b/src/Makefile.in index f176f65..6ef23d1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -16,6 +16,8 @@ pdf2swf.$(O): pdf2swf.c $(C) pdf2swf.c -o $@ pdf2pdf.$(O): pdf2pdf.c $(C) pdf2pdf.c -o $@ +gfx2gfx.$(O): gfx2gfx.c + $(C) gfx2gfx.c -o $@ gif2swf.$(O): gif2swf.c $(C) gif2swf.c -o $@ swfcombine.$(O): swfcombine.c @@ -102,12 +104,17 @@ swfrender$(E): swfrender.$(O) ../lib/libgfxswf$(A) ../lib/librfxswf$(A) ../lib/l $(STRIP) $@ PDF2SWF_OBJ=../lib/libgfxswf$(A) ../lib/librfxswf$(A) ../lib/libpdf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) +OCR_OBJ=../lib/libocr$(A) + pdf2swf$(E): pdf2swf.$(O) $(PDF2SWF_OBJ) $(LL) pdf2swf.$(O) -o $@ $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) $(STRIP) $@ pdf2pdf$(E): pdf2pdf.$(O) $(PDF2SWF_OBJ) $(LL) pdf2pdf.$(O) -o $@ $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) $(STRIP) $@ +gfx2gfx$(E): gfx2gfx.$(O) $(OCR_OBJ) $(PDF2SWF_OBJ) + $(LL) gfx2gfx.$(O) -o $@ $(OCR_OBJ) $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) + $(STRIP) $@ swfc$(E): parser.$(O) swfc.$(O) swfc-feedback.$(O) swfc-history.$(O) swfc-interpolation.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) $(L) parser.$(O) swfc.$(O) swfc-feedback.$(O) swfc-history.$(O) swfc-interpolation.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ @@ -122,9 +129,9 @@ uninstall: clean: rm -f *.o *.obj *.lo *.la *~ gmon.out - rm -f as3compile gif2swf swfbbox swfbytes swfbytes swfdump pdf2swf wav2swf png2swf swfcombine swfextract swfstrings png2swf jpeg2swf swfc font2swf - @rm -f gif2swf.exe swfbytes.exe swfbytes.exe pdf2swf.exe swfbbox.exe swfdump.exe wav2swf.exe png2swf.exe swfcombine.exe swfextract.exe swfstrings.exe png2swf.exe jpeg2swf.exe swfc.exe font2swf.exe - @rm -f gif2swf$(E) pdf2swf$(E) swfbytes$(E) swfbytes$(E) swfbbox$(E) swfdump$(E) wav2swf$(E) png2swf$(E) swfcombine$(E) swfextract$(E) swfstrings$(E) png2swf$(E) jpeg2swf$(E) swfc$(E) font2swf$(E) + rm -f as3compile gif2swf swfbbox swfbytes swfbytes swfdump pdf2swf wav2swf png2swf swfcombine swfextract swfstrings png2swf jpeg2swf swfc font2swf pdf2pdf gfx2gfx + @rm -f gif2swf.exe swfbytes.exe swfbytes.exe pdf2swf.exe swfbbox.exe swfdump.exe wav2swf.exe png2swf.exe swfcombine.exe swfextract.exe swfstrings.exe png2swf.exe jpeg2swf.exe swfc.exe font2swf.exe pdf2pdf.exe gfx2gfx.exe + @rm -f gif2swf$(E) pdf2swf$(E) swfbytes$(E) swfbytes$(E) swfbbox$(E) swfdump$(E) wav2swf$(E) png2swf$(E) swfcombine$(E) swfextract$(E) swfstrings$(E) png2swf$(E) jpeg2swf$(E) swfc$(E) font2swf$(E) pdf2pdf$(E) gfx2gfx$(E) doc: perl ../parsedoc.pl wav2swf.doc diff --git a/src/as3compile.c b/src/as3compile.c index 98ac30f..9ee4569 100644 --- a/src/as3compile.c +++ b/src/as3compile.c @@ -213,7 +213,6 @@ int main (int argc,char ** argv) } else { as3_add_include_dir(currentdir); } - registry_init(); int t; processargs(argc, argv); diff --git a/src/gfx2gfx.c b/src/gfx2gfx.c index 0a2d4d2..9ce3a13 100644 --- a/src/gfx2gfx.c +++ b/src/gfx2gfx.c @@ -34,7 +34,9 @@ #include "../../swftools/lib/devices/text.h" #include "../../swftools/lib/devices/render.h" #include "../../swftools/lib/devices/bbox.h" +#ifdef HAVE_LRF #include "../../swftools/lib/devices/lrf.h" +#endif #include "../../swftools/lib/devices/ocr.h" #include "../../swftools/lib/devices/rescale.h" #include "../../swftools/lib/devices/record.h" @@ -49,7 +51,7 @@ static char * outputname = 0; static int loglevel = 3; static char * pagerange = 0; static char * filename = 0; -static const char * format = "ocr"; +static const char * format = 0; int args_callback_option(char*name,char*val) { if (!strcmp(name, "o")) @@ -200,8 +202,16 @@ int main(int argn, char *argv[]) exit(1); } + if(!format) { + char*x = strrchr(outputname, '.'); + if(x) + format = x+1; + } + + gfxresult_t*result = 0; - if(!strcmp(format, "lrf")) { +#ifdef HAVE_LRF + if(!strcasecmp(format, "lrf")) { gfxdevice_t lrf; gfxdevice_lrf_init(&lrf); @@ -234,15 +244,17 @@ int main(int argn, char *argv[]) } } result = out->finish(out); - } else { + } else +#endif + { gfxdevice_t _out,*out=&_out; - if(!strcmp(format, "ocr")) { + if(!strcasecmp(format, "ocr")) { gfxdevice_ocr_init(out); - } if(!strcmp(format, "swf")) { + } if(!strcasecmp(format, "swf")) { gfxdevice_swf_init(out); - } if(!strcmp(format, "img")) { + } if(!strcasecmp(format, "img") || !strcasecmp(format, "png")) { gfxdevice_render_init(out); - } if(!strcmp(format, "txt")) { + } if(!strcasecmp(format, "txt")) { gfxdevice_text_init(out); }