开发者

How to make a resize with ImageMagick?

开发者 https://www.devze.com 2023-02-23 04:37 出处:网络
I need to create a thumb image of a remote 开发者_如何学运维jpeg image The question is rather general. There is a PHP tool called phpThumb that comfortably takes care of resizing and caching local and

I need to create a thumb image of a remote 开发者_如何学运维jpeg image


The question is rather general. There is a PHP tool called phpThumb that comfortably takes care of resizing and caching local and remote images. Once set up and configured, it is a great tool.


try using system:

system("convert <pathToImageToResize> -resize 64x64  <outputPath>");

for a remote picture you would need to fetch it, resize it, and then provide that image


It's as simple as downloading it, and then invoking the -resize thingy:

copy("http://example.com/image.jpeg", "img1.jpeg");
exec("mogrify -resize 50x50 img1.jpeg");

Take care with the file permissions and whatnot.

0

精彩评论

暂无评论...
验证码 换一张
取 消