国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > PHP > 正文

php gd等比例縮放壓縮圖片函數

2020-03-22 19:52:39
字體:
來源:轉載
供稿:網友
fclose($fp); return preg_match("/".chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0'."/",$image_head) false:true; * desription html' target='_blank'>壓縮圖片 * @param sting $imgsrc 圖片路徑 * @param string $imgdst 壓縮后保存路徑 function compressed_image($imgsrc,$imgdst){ list($width,$height,$type)=getimagesize($imgsrc); $new_width = ($width 600 600:$width)*0.9; $new_height =($height 600 600:$height)*0.9; switch($type){ case 1: $giftype=check_gifcartoon($imgsrc); if($giftype){ header('Content-Type:image/gif'); $image_wp=imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromgif($imgsrc); imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //75代表的是質量、壓縮圖片容量大小 imagejpeg($image_wp, $imgdst,75); imagedestroy($image_wp); break; case 2: header('Content-Type:image/jpeg'); $image_wp=imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($imgsrc); imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //75代表的是質量、壓縮圖片容量大小 imagejpeg($image_wp, $imgdst,75); imagedestroy($image_wp); break; case 3: header('Content-Type:image/png'); $image_wp=imagecreatetruecolor($new_width, $new_height); $image = imagecreatefrompng($imgsrc); imagecopyresampled($image_wp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); //75代表的是質量、壓縮圖片容量大小 imagejpeg($image_wp, $imgdst,75); imagedestroy($image_wp); break;php and gd 函數參考表
gd_info取得當前安裝的 GD 庫的信息
getimagesize取得圖像大小
getimagesizefromstringGet the size of an image from a string
image_type_to_extension取得圖像類型的文件后綴
image_type_to_mime_type取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的圖像類型的 MIME 類型
image2wbmp以 WBMP 格式將圖像輸出到瀏覽器或文件
imageaffineReturn an image containing the affine tramsformed src image, using an optional clipping area
imageaffinematrixconcatConcat two matrices (as in doing many ops in one go)
imageaffinematrixgetReturn an image containing the affine tramsformed src image, using an optional clipping area
imagealphablending設定圖像的混色模式
imageantialias是否使用抗鋸齒(antialias)功能
imagearc畫橢圓弧
imagechar水平地畫一個字符
imagecharup垂直地畫一個字符
imagecolorallocate為一幅圖像分配顏色
imagecolorallocatealpha為一幅圖像分配顏色 + alpha
imagecolorat取得某像素的顏色索引值
imagecolorclosest取得與指定的顏色最接近的顏色的索引值
imagecolorclosestalpha取得與指定的顏色加透明度最接近的顏色
imagecolorclosesthwb取得與給定顏色最接近的色度的黑白色的索引
imagecolordeallocate取消圖像顏色的分配
imagecolorexact取得指定顏色的索引值
imagecolorexactalpha取得指定的顏色加透明度的索引值
imagecolormatch使一個圖像中調色板版本的顏色與真彩色版本更能匹配
imagecolorresolve取得指定顏色的索引值或有可能得到的最接近的替代值
imagecolorresolvealpha取得指定顏色 + alpha 的索引值或有可能得到的最接近的替代值
imagecolorset給指定調色板索引設定顏色
imagecolorsforindex取得某索引的顏色
imagecolorstotal取得一幅圖像的調色板中顏色的數目
imagecolortransparent將某個顏色定義為透明色
imageconvolution用系數 div 和 offset 申請一個 3x3 的卷積矩陣
imagecopy拷貝圖像的一部分
imagecopymerge拷貝并合并圖像的一部分
imagecopymergegray用灰度拷貝并合并圖像的一部分
imagecopyresampled重采樣拷貝部分圖像并調整大小
imagecopyresized拷貝部分圖像并調整大小
imagecreate新建一個基于調色板的圖像
imagecreatefromgd2從 GD2 文件或 URL 新建一圖像
imagecreatefromgd2part從給定的 GD2 文件或 URL 中的部分新建一圖像
imagecreatefromgd從 GD 文件或 URL 新建一圖像
imagecreatefromgif由文件或 URL 創建一個新圖象。
imagecreatefromjpeg由文件或 URL 創建一個新圖象。
imagecreatefrompng由文件或 URL 創建一個新圖象。
imagecreatefromstring從字符串中的圖像流新建一圖像
imagecreatefromwbmp由文件或 URL 創建一個新圖象。
imagecreatefromwebp由文件或 URL 創建一個新圖象。
imagecreatefromxbm由文件或 URL 創建一個新圖象。
imagecreatefromxpm由文件或 URL 創建一個新圖象。
imagecreatetruecolor新建一個真彩色圖像
imagecropCrop an image using the given coordinates and size, x, y, width and height
imagecropautoCrop an image automatically using one of the available modes
imagedashedline畫一虛線
imagedestroy銷毀一圖像
imageellipse畫一個橢圓
imagefill區域填充
imagefilledarc畫一橢圓弧且填充
imagefilledellipse畫一橢圓并填充
imagefilledpolygon畫一多邊形并填充
imagefilledrectangle畫一矩形并填充
imagefilltoborder區域填充到指定顏色的邊界為止
imagefilter對圖像使用過濾器
imageflipFlips an image using a given mode
imagefontheight取得字體高度
imagefontwidth取得字體寬度
imageftbbox給出一個使用 FreeType 2 字體的文本框
imagefttext使用 FreeType 2 字體將文本寫入圖像
imagegammacorrect對 GD 圖像應用 gamma 修正
imagegd2將 GD2 圖像輸出到瀏覽器或文件
imagegd將 GD 圖像輸出到瀏覽器或文件
imagegif輸出圖象到瀏覽器或文件。
imagegrabscreenCaptures the whole screen
imagegrabwindowCaptures a window
imageinterlace激活或禁止隔行掃描
imageistruecolor檢查圖像是否為真彩色圖像
imagejpeg輸出圖象到瀏覽器或文件。
imagelayereffect設定 alpha 混色標志以使用綁定的 libgd 分層效果
imageline畫一條線段
imageloadfont載入一新字體
imagepalettecopy將調色板從一幅圖像拷貝到另一幅
imagepalettetotruecolorConverts a palette based image to true color
imagepng以 PNG 格式將圖像輸出到瀏覽器或文件
imagepolygon畫一個多邊形
imagepsbbox給出一個使用 PostScript Type1 字體的文本方框
imagepsencodefont改變字體中的字符編碼矢量
imagepsextendfont擴充或精簡字體
imagepsfreefont釋放一個 PostScript Type 1 字體所占用的內存
imagepsloadfont從文件中加載一個 PostScript Type 1 字體
imagepsslantfont傾斜某字體
imagepstext用 PostScript Type1 字體把文本字符串畫在圖像上
imagerectangle畫一個矩形
imagerotate用給定角度旋轉圖像
imagesavealpha設置標記以在保存 PNG 圖像時保存完整的 alpha 通道信息(與單一透明色相反)
imagescaleScale an image using the given new width and height
imagesetbrush設定畫線用的畫筆圖像
imagesetinterpolationSet the interpolation method
imagesetpixel畫一個單一像素
imagesetstyle設定畫線的風格
imagesetthickness設定畫線的寬度
imagesettile設定用于填充的貼圖
imagestring水平地畫一行字符串
imagestringup垂直地畫一行字符串
imagesx取得圖像寬度
imagesy取得圖像高度
imagetruecolortopalette將真彩色圖像轉換為調色板圖像
imagettfbbox取得使用 TrueType 字體的文本的范圍
imagettftext用 TrueType 字體向圖像寫入文本
imagetypes返回當前 PHP 版本所支持的圖像類型
imagewbmp以 WBMP 格式將圖像輸出到瀏覽器或文件
imagewebpOutput an WebP image to browser or file
imagexbm將 XBM 圖像輸出到瀏覽器或文件
iptcembed將二進制 IPTC 數據嵌入到一幅 JPEG 圖像中
iptcparse將二進制 IPTC 塊解析為單個標記
jpeg2wbmp將 JPEG 圖像文件轉換為 WBMP 圖像文件
png2wbmp將 PNG 圖像文件轉換為 WBMP 圖像文件以上就是本文的全部內容,希望對大家學習PHP程序設計有所幫助。PHP教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 虞城县| 祁东县| 黄骅市| 庐江县| 邵东县| 琼海市| 乌审旗| 防城港市| 太原市| 凯里市| 晋州市| 苗栗县| 昌江| 阿拉善右旗| 苏尼特右旗| 托克托县| 平遥县| 基隆市| 彩票| 崇左市| 乐东| 固阳县| 平顶山市| 永平县| 新平| 天峨县| 尖扎县| 勃利县| 滦南县| 林甸县| 潞西市| 永丰县| 临安市| 南京市| 庄河市| 东莞市| 东乌珠穆沁旗| 曲周县| 运城市| 葫芦岛市| 金门县|