swf元数据分析器

hexagonit.swfheader的Python项目详细描述


hexagonit.swfheader包提供单个函数- parse–能够解析swf(flash)中的元数据 动画)文件。主要用例是询问 帮助将文件嵌入HTML页面的SWF文件。

Usage

使用解析器非常简单,只需调用 hexagonit.swfheader.parse函数并用 文件系统路径或类似文件的对象。

>>> import hexagonit.swfheader
>>> metadata = hexagonit.swfheader.parse(TEST_SWF)
>>> pprint(metadata)
{'compressed': False,
 'fps': 12,
 'frames': 1,
 'height': 400,
 'size': 153,
 'version': 5,
 'width': 550,
 'xmax': 550,
 'xmin': 0,
 'ymax': 400,
 'ymin': 0}

函数parse返回包含 以下项目:

version (int)

The version of the Flash format, e.g. 7.

compressed (bool)

^{tt7}$, if the contents of the file are compressed using zlib compression, ^{tt8}$ otherwise.

size (int)

Byte size of the (uncompressed) contents of the SWF file.

xmin (int)

The lesser x-coordinate of the bounding rectangle of the contents.

xmax (int)

The greater x-coordinate of the bounding rectangle of the contents.

ymin (int)

The lesser y-coordinate of the bounding rectangle of the contents.

ymax (int)

The greater y-coordinate of the bounding rectangle of the contents.

width (int)

The width of the SWF file in pixels.

height (int)

The height of the SWF file in pixels.

frames (int)

The number of frames in the SWF file.

fps (int)

Frames per second.

Command line

与setuptools一起安装时,将放置名为swfheader的脚本 在您的bin目录中,可以使用它轻松地内省swf文件 在文件系统上:

$ swfheader some_file.swf
SWF header
----------
Version:      7
Compression:  False
Dimensions:   1105 x 1629
Bounding box: (0, 1105, 0, 1629)
Frames:       64
FPS:          1

Change history

1.2 (2012-07-18)

1.1 (2010-05-08)

  • Fixed a bug with parsing the “fps” and “frames” fields. The order of the fields were reversed and additionally the “fps” field was parsed incorrectly. Bug reported by Valeriy Zmiyevskoy. [dokai]

1.0.1 (2008-04-29)

  • Refacted a reversed() call to make the package Python 2.3 compatible.

1.0 (2008-04-16)

  • First public release [dokai]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
amazon web services Java AWS s3:如何使用Md5预签名url设置和上载内容   twitter使用java从推文中排除一些单词   如何在GUI java中添加延迟时间   java程序,如何使用Outputstream发送两次消息   java为什么是javax。在将Yasson与JSONB一起使用时,Glassfish中的json需要作为依赖项吗?   如何从dist文件夹中读取文件   java如何获取与模式匹配的文件列表   java如何使用Intent从Android应用程序发送彩信?   java限制对Spring的依赖,同时又不丧失框架的功能   java是否将捕获异常报告给Firebase/Fabric等?   用jdbcjava实现mysql分页   给定URI的java注释检索   java是序列化/反序列化公共枚举的简单方法?   java如何使用jMockit模拟本机方法