當前位置:首頁 » 文件管理 » thinkphp圖片壓縮

thinkphp圖片壓縮

發布時間: 2024-10-18 20:55:25

❶ thinkphp 怎麼用程序自動判斷壓縮圖片的大小

直接使用THINKPHP自帶的方法就能獲取了,你可以參考以下代碼!

$image=newThinkImage();
$image->open('./1.jpg');
$width=$image->width();//返回圖片的寬度
$height=$image->height();//返回圖片的高度
$type=$image->type();//返回圖片的類型
$mime=$image->mime();//返回圖片的mime類型
$size=$image->size();//返回圖片的尺寸數組0圖片寬度1圖片高度


原生PHP是這樣的:

//intfilesize(string$filename)

//輸出類似:somefile.txt:1024bytes

$filename='somefile.txt';
echo$filename.':'.filesize($filename).'bytes';
熱點內容
java文字圖片 發布:2025-07-11 17:49:48 瀏覽:559
廣發銀行為什麼要密碼登錄 發布:2025-07-11 17:46:48 瀏覽:337
支付密碼有可能是多少 發布:2025-07-11 17:41:21 瀏覽:997
怎麼緩存視頻到手機 發布:2025-07-11 17:34:39 瀏覽:81
熱血江湖端游如何進伺服器 發布:2025-07-11 17:24:18 瀏覽:879
傳奇腳本幾率 發布:2025-07-11 17:23:35 瀏覽:737
動態密碼在哪裡手機版 發布:2025-07-11 17:23:25 瀏覽:467
ftp打開是網頁 發布:2025-07-11 17:17:26 瀏覽:202
睿騁cc哪個配置帶遠程啟動 發布:2025-07-11 17:15:44 瀏覽:784
oracle返回參數的存儲過程 發布:2025-07-11 17:12:30 瀏覽:509