2024 年 PHP 日本研討會

預定義常數

以下常數由此擴充功能定義,並且僅在擴充功能已編譯到 PHP 中或在執行階段動態載入時才可用。

GD_VERSION (字串)
PHP 編譯時所使用的 GD 版本。
GD_MAJOR_VERSION (整數)
PHP 編譯時所使用的 GD 主要版本。
GD_MINOR_VERSION (整數 (int))
PHP 編譯時所使用的 GD 次要版本。
GD_RELEASE_VERSION (整數 (int))
PHP 編譯時所使用的 GD 發行版本。
GD_EXTRA_VERSION (字串 (string))
PHP 編譯時所使用的 GD「額外」版本(beta/rc...)。
GD_BUNDLED (整數 (int))
當使用 GD 的內建版本時,此值為 1,否則設為 0。
IMG_AVIF (整數 (int))
做為 imagetypes() 的回傳值 (PHP 8.1.0 起可用)
IMG_BMP (整數 (int))
做為 imagetypes() 的回傳值。
IMG_GIF (整數 (int))
做為 imagetypes() 的回傳值。
IMG_JPG (整數 (int))
做為 imagetypes() 的回傳值。
IMG_JPEG (整數 (int))
做為 imagetypes() 的回傳值。

注意事項:

此常數與 IMG_JPG 的值相同。

IMG_PNG (整數 (int))
做為 imagetypes() 的回傳值。
IMG_TGA (整數 (int))
做為 imagetypes() 的回傳值 (PHP 7.4.0 起可用)
IMG_WBMP (整數 (int))
做為 imagetypes() 的回傳值。
IMG_XPM (整數 (int))
做為 imagetypes() 的回傳值。
IMG_WEBP (整數 (int))
做為 imagetypes() 的回傳值 (PHP 7.0.10 起可用)
IMG_WEBP_LOSSLESS (整數 (int))
(PHP 8.1.0 起可用)
IMG_COLOR_TILED (整數 (int))
特殊的顏色選項,可以取代使用 imagecolorallocate()imagecolorallocatealpha() 分配的顏色。
IMG_COLOR_STYLED (整數 (int))
特殊的顏色選項,可以取代使用 imagecolorallocate()imagecolorallocatealpha() 分配的顏色。
IMG_COLOR_BRUSHED (整數 (int))
特殊的顏色選項,可以取代使用 imagecolorallocate()imagecolorallocatealpha() 分配的顏色。
IMG_COLOR_STYLEDBRUSHED (整數 (int))
特殊的顏色選項,可以取代使用 imagecolorallocate()imagecolorallocatealpha() 分配的顏色。
IMG_COLOR_TRANSPARENT (整數 (int))
特殊的顏色選項,可以取代使用 imagecolorallocate()imagecolorallocatealpha() 分配的顏色。
IMG_AFFINE_TRANSLATE (整數 (int))
一種仿射變換類型常數,由 imageaffinematrixget() 函式使用。
IMG_AFFINE_SCALE (整數 (int))
一種仿射變換類型常數,由 imageaffinematrixget() 函式使用。
IMG_AFFINE_ROTATE (整數 (int))
一種仿射變換類型常數,由 imageaffinematrixget() 函式使用。
IMG_AFFINE_SHEAR_HORIZONTAL (整數 (int))
一種仿射變換類型常數,由 imageaffinematrixget() 函式使用。
IMG_AFFINE_SHEAR_VERTICAL (整數 (int))
一種仿射變換類型常數,由 imageaffinematrixget() 函式使用。
IMG_ARC_ROUNDED (整數 (int))
imagefilledarc() 函式使用的樣式常數。

注意事項:

此常數與 IMG_ARC_PIE 的值相同。

IMG_ARC_PIE (整數 (int))
imagefilledarc() 函式使用的樣式常數。
IMG_ARC_CHORD (整數 (int))
imagefilledarc() 函式使用的樣式常數。
IMG_ARC_NOFILL (整數 (int))
imagefilledarc() 函式使用的樣式常數。
IMG_ARC_EDGED (整數 (int))
imagefilledarc() 函式使用的樣式常數。
IMG_GD2_RAW (整數 (int))
imagegd2() 函式使用的類型常數。
IMG_GD2_COMPRESSED (整數 (int))
imagegd2() 函式使用的類型常數。
IMG_EFFECT_REPLACE (整數 (int))
imagelayereffect() 函式使用的 Alpha 混合效果。
IMG_EFFECT_ALPHABLEND (整數 (int))
imagelayereffect() 函式使用的 Alpha 混合效果。
IMG_EFFECT_NORMAL (整數 (int))
imagelayereffect() 函式使用的 Alpha 混合效果。
IMG_EFFECT_OVERLAY (整數 (int))
imagelayereffect() 函式使用的 Alpha 混合效果。
IMG_EFFECT_MULTIPLY (整數 (int))
imagelayereffect() 函式使用的 Alpha 混合效果。
IMG_FILTER_NEGATE (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_GRAYSCALE (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_BRIGHTNESS (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_CONTRAST (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_COLORIZE (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_EDGEDETECT (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_GAUSSIAN_BLUR (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_SELECTIVE_BLUR (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_EMBOSS (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_MEAN_REMOVAL (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_SMOOTH (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_PIXELATE (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。
IMG_FILTER_SCATTER (整數 (int))
imagefilter() 函式使用的特殊 GD 濾鏡。 (PHP 7.4.0 起可用)
IMAGETYPE_GIF (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JPEG (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JPEG2000 (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_PNG (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_SWF (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_PSD (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_BMP (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_WBMP (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_XBM (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_TIFF_II (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_TIFF_MM (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_IFF (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JB2 (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JPC (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JP2 (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_JPX (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_SWC (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_ICO (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_WEBP (整數 (int))
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。 (PHP 7.1.0 起可用)
IMAGETYPE_AVIF (整數)
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。 (PHP 8.1.0 起可用)
IMAGETYPE_UNKNOWN (整數)
image_type_to_mime_type()image_type_to_extension() 函式使用的圖片類型常數。
IMAGETYPE_COUNT (整數)
image_type_to_mime_type()image_type_to_extension() 函式所支援的圖片類型常數數量(包含「未知」類型)。
PNG_NO_FILTER (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_FILTER_NONE (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_FILTER_SUB (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_FILTER_UP (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_FILTER_AVG (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_FILTER_PAETH (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
PNG_ALL_FILTERS (整數)
一個特殊的 PNG 過濾器,由 imagepng() 函式使用。
IMG_FLIP_VERTICAL (整數)
imageflip() 搭配使用,PHP 5.5.0 起可用。
IMG_FLIP_HORIZONTAL (整數)
imageflip() 搭配使用,PHP 5.5.0 起可用。
IMG_FLIP_BOTH (整數)
imageflip() 搭配使用,PHP 5.5.0 起可用。
IMG_BELL (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BESSEL (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BILINEAR_FIXED (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BICUBIC (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BICUBIC_FIXED (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BLACKMAN (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BOX (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_BSPLINE (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_CATMULLROM (整數)
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_GAUSSIAN (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_GENERALIZED_CUBIC (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_HERMITE (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_HAMMING (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_HANNING (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_MITCHELL (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_POWER (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_QUADRATIC (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_SINC (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_NEAREST_NEIGHBOUR (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_WEIGHTED4 (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_TRIANGLE (整數 (int))
imagesetinterpolation() 搭配使用,PHP 5.5.0 起可用。
IMG_CROP_BLACK (整數 (int))
裁剪掉黑色背景。
IMG_CROP_DEFAULT (整數 (int))
IMG_CROP_TRANSPARENT 相同。在 PHP 7.4.0 之前,如果圖像沒有透明顏色,則綁定的 libgd 會退回到 IMG_CROP_SIDES
IMG_CROP_SIDES (整數 (int))
使用圖像的四個角來嘗試檢測要裁剪的背景。
IMG_CROP_THRESHOLD (整數 (int))
使用給定的 門檻值 (threshold)顏色 (color) 裁剪圖像。
IMG_CROP_TRANSPARENT (整數 (int))
裁剪掉透明背景。
IMG_CROP_WHITE (整數 (int))
裁剪掉白色背景。
新增註解

使用者貢獻的註解 1 則註解

webmaster at alexventure dot com
13 年前
如果有人想知道這些濾鏡的用途,請查看 W3C 的規範

http://www.w3.org/TR/PNG-Filters.html
To Top