(PHP 8 >= 8.1.0)
imageavif — 輸出圖象到瀏覽器或文件。
$image,$file = null,$quality = -1,$speed = -1
Outputs or saves a AVIF Raster image from the given image.
image由圖象創(chuàng)建函數(shù)(例如imagecreatetruecolor())返回的 GdImage 對(duì)象。
file
文件保存的路徑或者已打開的流資源(此方法返回后自動(dòng)關(guān)閉該流資源),如果未設(shè)置或?yàn)?null,將會(huì)直接輸出原始圖象流。
quality
quality is optional, and ranges from 0 (worst quality, smaller file)
to 100 (best quality, larger file).
If -1 is provided, the default value 30 is used.
speed
speed is optional, and ranges from 0 (slow, smaller file)
to 10 (fast, larger file).
If -1 is provided, the default value 6 is used.
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。
如果 libgd 輸出圖像失敗,函數(shù)會(huì)返回 true。