hem*_*iya 3 php svg gd laravel laravel-4
我有代码,可用于jpg,png图像调整图像大小,这里是代码示例.
$image = Image::make("{$filePath}/{$fileName[0]}");
// Get the maximum uploaded image width
$maxWidth = Config::get('constants.max_uploaded_image_width');
// Resize the image
$image->resize($maxWidth, null, function($constraint)
{
// Set an aspect ratio constraint
$constraint->aspectRatio();
// Prevent upsizing
$constraint->upsize();
});
// Save the image
$image->save("{$filePath}/{$fileName[0]}");
Run Code Online (Sandbox Code Playgroud)
这个jpg和png图像一起工作很好,但是当我使用svg它时会返回错误Unable to read image from file.有解决方案吗
SVG不支持Intervention Image:
http://image.intervention.io/getting_started/formats
您可以使用ImageMagick进行操作SVG.
| 归档时间: |
|
| 查看次数: |
1401 次 |
| 最近记录: |