Home >Backend Development >PHP Tutorial >Thinkphp calls the Image class to generate thumbnails_PHP tutorial
This article mainly introduces the method of Thinkphp calling the Image class to generate thumbnails, and an example analysis of Thinkphp calling the Image class to generate thumbnails Friends in need can refer to the usage principles and related techniques
The example in this article describes how Thinkphp calls the Image class to generate thumbnails. Share it with everyone for your reference. The specific analysis is as follows:
Thinkphp’s Image class is in ThinkPHP/Extend/Library/ORG/Util/Image.class.php.
The calling method is as follows:
?
3 4 5 6
7
|
$image_path = './image path'; //If the current php file is in the APP_PATH path of Thinkphp //'./' is the upper-level file of index.php. //Because APP_PATH is defined and loaded through index.php.
|
1 2 | //Generate thumbnail: $Img::thumb2($img_path,$thumb_name,$thumb_type,$Max_width,$Max_height); |