复制代码 代码如下: <?php /* ;Translate the image format using the original image size [Translation] width=0 height=0
;Stretch the image to the specified size [Stretch] width=800 height=600
;Zoom the image to the specified Width with height auto size [AutoHeight] width=740 height=0
;Zoom the image to the specified Height with width auto size [AutoWidth] width=0 height=380 */ ?>
下面是编写的缩放图片的php代码,其中变量classes是一个数组,可以选择任意多个ini文件中指定的设置: 复制代码 代码如下: <?php $oimg = "test.jpg";//Original image name $classes = array("Translation","AutoHeight","AutoWidth","Stretch");//Give classes for the new creating images" size which are defined in the specified ini file $suffix = "jpg";//The new image"s suffix $inifile = "image.ini.php";