I know that can get the dimentions of an image and a video file, but if it possible to get the dimensions of a swf ( flash) file ?
http://us3.php.net/manual/en/function.getimagesize.php#47785 that gives you the dimensions on a video.
what about flash files ?
You probably tried this already... But did you try just using filename.swf in the code you showed?
One of the comments from the PHP Manual
If you are using a php version with the bug where GetImageSize returns nothing on certain types of jpeg images, the following replacement should solve the problem until you have upgraded. It accuratly duplicates the 1st and 2nd array element which are the ones I personally needed. I however added the 4th array element and a crude implementation of the 3rd since some people may need the functionality or find it usefull. I hopefully reformated the function to not be wordwrapped and it is worth noting that as it is written, it only will work on local files. Additional error checking may be wise. function sgetimagesize($filename) { $ftype_array = array(".gif"=>"1", ".jpg"=>"2", ".jpeg"=>"2", ".png"=>"3", ".swf"=>"4", ".psd"=>"5", ".bmp"=>"6"); if (is_file($filename)) { $fd = @fopen($filename,"r"); $image_string = fread($fd,filesize($filename)); $im = ImageCreateFromString($image_string); $ftype = $ftype_array[get_file_ext($filename)]; $gis[0] = ImageSX($im); $gis[1] = ImageSY($im); $gis[2] = ($ftype?$ftype:"0"); $gis[3] = "width={$gis[0]} height={$gis[1]}"; ImageDestroy($im); return $gis_array; } else { return false; } }
If you are using a php version with the bug where GetImageSize returns nothing on certain types of jpeg images, the following replacement should solve the problem until you have upgraded. It accuratly duplicates the 1st and 2nd array element which are the ones I personally needed. I however added the 4th array element and a crude implementation of the 3rd since some people may need the functionality or find it usefull. I hopefully reformated the function to not be wordwrapped and it is worth noting that as it is written, it only will work on local files. Additional error checking may be wise.
function sgetimagesize($filename) { $ftype_array = array(".gif"=>"1", ".jpg"=>"2", ".jpeg"=>"2", ".png"=>"3", ".swf"=>"4", ".psd"=>"5", ".bmp"=>"6"); if (is_file($filename)) { $fd = @fopen($filename,"r"); $image_string = fread($fd,filesize($filename)); $im = ImageCreateFromString($image_string); $ftype = $ftype_array[get_file_ext($filename)]; $gis[0] = ImageSX($im); $gis[1] = ImageSY($im); $gis[2] = ($ftype?$ftype:"0"); $gis[3] = "width={$gis[0]} height={$gis[1]}"; ImageDestroy($im); return $gis_array; } else { return false; } }
Another comment
This will not work for swf files unless zlib is compiled into php statically (not as a shared module). Bug #29611 As of PHP 5.0.0 it will just return false, but that should change to a notice by the next release.
This will not work for swf files unless zlib is compiled into php statically (not as a shared module). Bug #29611
As of PHP 5.0.0 it will just return false, but that should change to a notice by the next release.
Hope this helps.