开发者

How to make a resize with ImageMagick?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜