从纯Python中的Flash文件(.swf)获取维度 [英] Get dimensions from a flash file (.swf) in pure-Python
问题描述
如何从Flash文件中提取尺寸(宽度和高度)?
How would I extract the dimensions (width and height) from a flash file?
我打算在托管在Google App Engine上的webapp中使用此代码没有纯python的库是行不通的。
I intend on using this code inside a webapp hosted on Google App Engine, so libs that are no pure-python will not work.
推荐答案
我从来没有真正使用它,但我怀疑<一个href =http://pypi.python.org/pypi/hexagonit.swfheader/1.0.1> hexagonit.swfheader 模块可以用于你的目的。它是纯粹的python,很小的(包括一个测试用例的完整源代码是一个4KB的压缩包)。我创建了或多或少正是你正在做的事情。
I've never actually used it, but I suspect that the hexagonit.swfheader module would work for your purposes. It is pure python, and tiny (full source including a test-case is a 4KB tarball.) I was created for more or less exactly what you are doing.
I应该提到它声称是根据GPL许可的,所以这可能是一个问题。无论如何,它实际上只是从SWF文件头中提取一些字节并解释它们。如果您担心授权问题,重写将是相当容易的。
I should mention that it claims to be licensed under the GPL, so that may be a problem. Regardless, all it is actually doing is extracting some bytes from the header of the SWF file and interpreting them. It would be reasonably easy to rewrite if you were worried about licensing issues.
这篇关于从纯Python中的Flash文件(.swf)获取维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!