tags:

views:

947

answers:

2

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?

+1  A: 

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

karim79
Okay, thanks Karim79 that looks quite usefull! Let's implement now.
tvgemert
@tvgemert - if getimagesize does it, as codeburger suggested, then *definately* go with that solution.
karim79
+5  A: 

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

code_burgar
+1 - cool, I didn't know getimagesize did .swf
karim79
@codeburger -)
tvgemert