How to embed remote image in ImageMagick

ewinlesov

New Member
I'm trying to do a simple thumbnail generation from an image that isn't located on my server using the iMagick wrapper for ImageMagick. For some reason, the following code will not display anything when called:\[code\]<?php $image = new Imagick("http://kunaki.com/ProductImage.ASP?T=I&ST=FO&PID=PX003Y9EDJ"); $image->thumbnailImage(100, 0); header( "Content-Type: image/jpg" ); echo $image;?>\[/code\]I've also tried using \[code\]http://kunaki.com/ProductImage.ASP?T=I&ST=FO&PID=PX003Y9EDJ.jpg\[/code\] to no avail.Based on comments below, I've attempted this as well with no results, but am not sure if the syntax is correct.\[code\]<?php $kunaki_image = file_get_contents("http://kunaki.com/ProductImage.ASP?T=I&ST=FO&PID=PX003Y9EDJ"); $name = tempnam("/tmp", "kunaki"); $final = file_put_contents($name, $kunaki_image); $image = new Imagick($final); $image->thumbnailImage(100, 0); header( "Content-Type: image/jpg" ); echo $image;?>\[/code\]Does anyone have any suggestions?Thanks!
 
Back
Top