Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php yii-如何从yii图像组件获取图像宽度和高度属性_Php_Image_Yii_Components - Fatal编程技术网

php yii-如何从yii图像组件获取图像宽度和高度属性

php yii-如何从yii图像组件获取图像宽度和高度属性,php,image,yii,components,Php,Image,Yii,Components,我正在管理此组件上载的图像 使用此组件,我可以调整大小、旋转、移动图像& 但在本例中,我希望获得文件的大小属性(宽度和高度) 并检查它的宽度是否大于我的限制(例如100px),所以将其调整到这个大小并保存它 我可以用这个图像组件吗 我找到了检查$image->width或$image->height的方法 还有其他优化方法吗?它使用,因此您应该能够使用 $image->getSize()->getWidth(); $image->getSize()->getHeigh

我正在管理此组件上载的图像

使用此组件,我可以调整大小、旋转、移动图像&

但在本例中,我希望获得文件的大小属性(宽度和高度)

并检查它的宽度是否大于我的限制(例如100px),所以将其调整到这个大小并保存它

我可以用这个图像组件吗

我找到了检查$image->width或$image->height的方法

还有其他优化方法吗?

它使用,因此您应该能够使用

$image->getSize()->getWidth();
$image->getSize()->getHeight();
当然,你可以用它做各种各样的图像处理。我们现在使用它大约有一年了,非常满意