iqnection-modules / image-utilities
IQnection SilverStripe 图像工具模块
1.0.0
2021-04-07 14:00 UTC
Requires
- intervention/image: ^2.3
- silverstripe/framework: ^4.1
This package is auto-updated.
Last update: 2024-09-07 21:14:57 UTC
README
安装
composer require iqnection-modules/image-utilities
其他方法
- FillFrom & FillMaxFrom: 允许您从所需位置裁剪图像,而不仅仅是中心位置
$MyImage.CropFrom(300,300,'top')
<%-- pulling position from controller --%>
$MyImage.CropFrom(300,300,$CropPosition)
<img src="$MyImage.CropFrom(300,300,'top').URL" />
配置
如果您的模板中没有指定,您必须将裁剪位置添加到提供图像的模型或控制器中。默认为"中心"。