imagetypes
(PHP 4 >= 4.0.2, PHP 5, PHP 7)
imagetypes — Возвращает список типов изображений, поддерживаемых PHP сборкой
Описание
int imagetypes
( void
)
Возвращает типы поддерживаемых текущей сборкой PHP изображений.
Возвращаемые значения
Возвращает битовое поле соответствующее форматам изображений, которые
поддерживаются текущей версией GD прилинкованной к PHP. Возвращаются следующие
биты:
IMG_GIF
| IMG_JPG
|
IMG_PNG
| IMG_WBMP
|
IMG_XPM
.
Примеры
Пример #1 Проверка поддержки PNG
<?php
if (imagetypes() & IMG_PNG) {
echo "Поддержка PNG включена";
}
?>
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Обработка и генерация изображений
- Обработка изображений и GD
- gd_info
- getimagesize
- getimagesizefromstring
- image_type_to_extension
- image_type_to_mime_type
- image2wbmp
- imageaffine
- imageaffinematrixconcat
- imageaffinematrixget
- imagealphablending
- imageantialias
- imagearc
- imagechar
- imagecharup
- imagecolorallocate
- imagecolorallocatealpha
- imagecolorat
- imagecolorclosest
- imagecolorclosestalpha
- imagecolorclosesthwb
- imagecolordeallocate
- imagecolorexact
- imagecolorexactalpha
- imagecolormatch
- imagecolorresolve
- imagecolorresolvealpha
- imagecolorset
- imagecolorsforindex
- imagecolorstotal
- imagecolortransparent
- imageconvolution
- imagecopy
- imagecopymerge
- imagecopymergegray
- imagecopyresampled
- imagecopyresized
- imagecreate
- imagecreatefromgd2
- imagecreatefromgd2part
- imagecreatefromgd
- imagecreatefromgif
- imagecreatefromjpeg
- imagecreatefrompng
- imagecreatefromstring
- imagecreatefromwbmp
- imagecreatefromwebp
- imagecreatefromxbm
- imagecreatefromxpm
- imagecreatetruecolor
- imagecrop
- imagecropauto
- imagedashedline
- imagedestroy
- imageellipse
- imagefill
- imagefilledarc
- imagefilledellipse
- imagefilledpolygon
- imagefilledrectangle
- imagefilltoborder
- imagefilter
- imageflip
- imagefontheight
- imagefontwidth
- imageftbbox
- imagefttext
- imagegammacorrect
- imagegd2
- imagegd
- imagegif
- imagegrabscreen
- imagegrabwindow
- imageinterlace
- imageistruecolor
- imagejpeg
- imagelayereffect
- imageline
- imageloadfont
- imagepalettecopy
- imagepalettetotruecolor
- imagepng
- imagepolygon
- imagepsbbox
- imagepsencodefont
- imagepsextendfont
- imagepsfreefont
- imagepsloadfont
- imagepsslantfont
- imagepstext
- imagerectangle
- imagerotate
- imagesavealpha
- imagescale
- imagesetbrush
- imagesetinterpolation
- imagesetpixel
- imagesetstyle
- imagesetthickness
- imagesettile
- imagestring
- imagestringup
- imagesx
- imagesy
- imagetruecolortopalette
- imagettfbbox
- imagettftext
- imagetypes
- imagewbmp
- imagewebp
- imagexbm
- iptcembed
- iptcparse
- jpeg2wbmp
- png2wbmp
Коментарии
In case anyone is wondering what values these constants have
<?php
$imagetypes = array('IMG_AVIF', 'IMG_BMP', 'IMG_GIF', 'IMG_JPG', 'IMG_PNG', 'IMG_WBMP', 'IMG_XPM', 'IMG_WEBP');
foreach ($imagetypes as $imagetype) {
echo constant($imagetype) . "\t" . $imagetype . "\r\n";
}
/* would output
256 IMG_AVIF
64 IMG_BMP
1 IMG_GIF
2 IMG_JPG
4 IMG_PNG
8 IMG_WBMP
16 IMG_XPM
32 IMG_WEBP
*/
?>