-1
A
回答
0
我不知道什麼是你的代碼錯誤,因爲你還沒有公佈,但這裏是我用來創建縮略圖
function make_thumb($src, $dest, $desired_width) {
/* read the source image */
$source_image = imagecreatefromjpeg($src);
$width = imagesx($source_image);
$height = imagesy($source_image);
/* find the "desired height" of this thumbnail, relative to the desired width */
$desired_height = floor($height * ($desired_width/$width));
/* create a new, "virtual" image */
$virtual_image = imagecreatetruecolor($desired_width, $desired_height);
/* copy source image at a resized size */
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
/* create the physical thumbnail image to its destination */
imagejpeg($virtual_image, $dest);
}
$ SRC一個方便的功能: URL到您的圖像
$ DES:在您想要的縮略圖是
$寬度:您的縮略圖的寬度
相關問題
- 1. 自動調整圖像
- 2. 圖像不自動調整
- 3. 自動調整圖像
- 4. 用jquery自動調整圖像大小
- 5. 用ImageMagick自動調整圖像
- 6. 啓用自動圖像調整大小
- 7. HTML網站的自動調整代碼
- 8. 調整圖像使用PHP
- 9. PHP調整圖像
- 10. 自動調整大小的backgorund圖像
- 11. JButton中的圖像自動調整?
- 12. 適應asp.net代碼來調整圖像
- 13. 關於圖像的PHP代碼幫助
- 14. PHP高級圖像調整大小,類似於iOS調整圖像的大小
- 15. css代碼來調整動態創建的圖像的大小
- 16. php:自動縮進整個代碼?
- 17. 我「png格式」圖像大小調整圖像的代碼在PHP
- 18. 基於分辨率的自動背景圖像調整大小
- 19. Android - 在ImageView中自動調整圖像?
- 20. 自動圖像大小調整再
- 21. 自動調整手機背景圖像
- 22. ImageButton將自動調整圖像
- 23. 自動調整圖像填充div
- 24. 自動裁剪和調整圖像
- 25. Bullet圖像自動調整大小
- 26. Android佈局和自動圖像調整
- 27. C#圖像自動調整大小
- 28. 自動調整圖像大小
- 29. 隨機圖像自動重新調整
- 30. 加載圖像自動調整大小