Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP get dimensions of SWF file

Tags:

php

flash

I'm trying to load an swf file and dynamically determine its height and width. Is there something anyone knows about that can read the dimensions of the swf file using PHP?

Here's what worked for anyone who needs it:

$aInfo = getimagesize($sFile);
list($iWidth, $iHeight) = $aInfo;
like image 934
tmartin314 Avatar asked Dec 21 '10 05:12

tmartin314


1 Answers

use getimagesize

example:

php -r "print_r(getimagesize('http://adsatt.espn.go.com/ad/sponsors/ibm/Oct_2010/ibm0-728x90-0160.swf'));"
Array
(
    [0] => 728
    [1] => 90
    [2] => 13
    [3] => width="728" height="90"
    [mime] => application/x-shockwave-flash
)

PS: module gd is required

like image 149
ajreal Avatar answered Oct 16 '22 16:10

ajreal