What are the potential pitfalls or misunderstandings when using getimagesize() with .swf files in PHP?

When using getimagesize() with .swf files in PHP, it's important to note that this function is specifically designed for image files and may not work correctly with Flash files. To properly handle .swf files, you can use the getimagesize() function along with the SWFTools library to extract image dimensions from the Flash file.

// Path to the SWF file
$swf_file = 'example.swf';

// Use SWFTools to get the dimensions of the SWF file
$swf_info = new SWF($swf_file);
$width = $swf_info->header->width;
$height = $swf_info->header->height;

// Output the dimensions
echo "Width: $width, Height: $height";