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.
精彩评论