X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpython%2Fgfx.c;h=3ea625aaf795f86d1a2024456c3b4f640fa570b2;hb=40f56dc3acf79a5625a33e93f6615e358d649575;hp=5bc2068064b20a11c0d0296b5ad44a4989a38b91;hpb=cff493c8c3d14392786e3415478faf62423f71b5;p=swftools.git diff --git a/lib/python/gfx.c b/lib/python/gfx.c index 5bc2068..3ea625a 100644 --- a/lib/python/gfx.c +++ b/lib/python/gfx.c @@ -726,6 +726,8 @@ static PyObject* f_open(PyObject* parent, PyObject* args, PyObject* kwargs) type = "image"; if(strchr("pP", filename[l-3]) && strchr("nN", filename[l-2]) && strchr("gG", filename[l-1])) type = "image"; + if(strchr("sS", filename[l-3]) && strchr("wW", filename[l-2]) && strchr("fF", filename[l-1])) + type = "swf"; } else if(filename[l-5]=='.') { type = "image"; } @@ -734,9 +736,9 @@ static PyObject* f_open(PyObject* parent, PyObject* args, PyObject* kwargs) if(!strcmp(type,"pdf")) self->doc = pdfdriver->open(pdfdriver,filename); - else if(!strcmp(type, "image")) + else if(!strcmp(type, "image") || !strcmp(type, "img")) self->doc = imagedriver->open(imagedriver, filename); - else if(!strcmp(type, "swf")) + else if(!strcmp(type, "swf") || !strcmp(type, "SWF")) self->doc = swfdriver->open(imagedriver, filename); else return PY_ERROR("Unknown type %s", type);