1

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?

3 Answers 3

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

@codeburger & @karim79 getImageSize indeed does the job! After searching the net I expected a more difficult solution than that! Using getimagesize is definitely not the first search result I've encountered before asking here ;-)
2

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

2 Comments

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.