jump to navigation

How to get the dimensions of a .swf file in PHP March 25, 2011

Posted by Tournas Dimitrios in PHP.
trackback

You may think that it is quite hard do get the width and height of a .swf file using PHP. However, it is extremely easy using the getimagesize function.

$swfDimensions = getimagesize($pathToSwf);
 
if($imageSize)

{
    $width  = $swfDimensions[0];
    $height = $swfDimensions[1];
}
else
{
    throw new Exception("It has been imposible to retrieve the dimensions of the swf file ".$pathToSwf);

}

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s