def doit(inf, outf): swf = SWF(inf) # swf-in-an-swf data = getimagedata(swf) swf2 = SWF(StringIO(data)) exporter = SVGExporter() svg = swf2.export(exporter) outf.write(svg.read())
from swf.movie import SWF from swf.export import SVGExporter # create a file object file = open('C:/Users/Hamed/IGC/Desktop/trash/1.swf', 'rb') # load and parse the SWF swf = SWF(file) # print SWF(file) # create the SVG exporter svg_exporter = SVGExporter() # export! svg = swf.export(svg_exporter) # save the SVG open('C:/Users/Hamed/IGC/Desktop/trash/1.svg', 'wb').write(svg.read()) import gfx doc = gfx.open("swf", "C:/Users/Hamed/IGC/Desktop/trash/1.swf") for pagenr in range(1,doc.pages+1): page = doc.getPage(pagenr) print "Page", pagenr, "has dimensions", page.width, "x", page.height from PIL import Image i = Image.open(image_address)
'problem maybe ocurred because this is working by linux system and you are using windows system' from swf.movie import SWF from swf.export import SVGExporter # create a file object file = open('C:/Users/Hamed/IGC/Desktop/trash/1.swf', 'rb') # load and parse the SWF swf = SWF(file) # print SWF(file) # create the SVG exporter svg_exporter = SVGExporter() # export! svg = swf.export(svg_exporter) # save the SVG open('C:/Users/Hamed/IGC/Desktop/trash/1.svg', 'wb').write(svg.read()) import gfx doc = gfx.open("swf", "C:/Users/Hamed/IGC/Desktop/trash/1.swf") for pagenr in range(1, doc.pages + 1): page = doc.getPage(pagenr) print "Page", pagenr, "has dimensions", page.width, "x", page.height from PIL import Image i = Image.open(image_address) pixels2 = i.load() # this is not a list, nor is it list()'able