tvgemert
tvgemert

Reputation: 1486

Get SWF file information using PHP (or javascript)

For one of my projects I would like to use PHP to read an SWF file on the server and get the dimensions of the stage of the SWF. So, the SWF file is not yet embedded in the page. Does anybody know if this is possible and which route I should take?

Upvotes: 1

Views: 6215

Answers (3)

Alex Yam
Alex Yam

Reputation: 41

For those looking for a solution to getimagesize() on .SWF files stored in the database, here is a blob-data-as-file-stream wrapper I wrote. Tested on PHP 5.3.10.

http://pastebin.com/6uriJMZv

Upvotes: 1

code_burgar
code_burgar

Reputation: 12323

Use getimagesize() , it works perfectly with swf files.

Upvotes: 5

karim79
karim79

Reputation: 342765

See this (SWF Header Parser Class - licensed under LGPL):

http://www.phpclasses.org/browse/package/1653.html

The website says this:

This class is meant to parse the header of Shockwave Flash animation files (.swf) to extract metadata information like the width and height of animation, compression status and uncompressed size, frame rate and total number of frames.

This class parses Flash files using only PHP code, so no special extension is necessary.

Supports both, compressed and uncompressed SWF Flash movies

Upvotes: 2

Related Questions