PDA

Просмотр полной версии : Как узнать из php размеры баннера?


taifa
22.01.2007, 09:22
Необходимо программным путем узнать размеры flash-ролика, лежащего по некоторому пути. Если эти размеры не совпадают с требуемыми, вывести соответствующее предупреждение.

Kikasso
22.01.2007, 09:31
getimagesize()
для 8-ки работает, для ранних версий не знаю - попробуйте.
других путей вроде бы нет.
(PHP 3, PHP 4, PHP 5)
getimagesize -- Get the size of an image
Description
array getimagesize ( string filename [, array &imageinfo] )

The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and return the dimensions along with the file type .....
.....
Замечание: The getimagesize() function does not require the GD image library.

Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3.0. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag.

taifa
22.01.2007, 11:29
сенк ю))