I need to resize some images on another server (create thumbnails). I got some code online and simplified it. If the image is on my local server it works, but if I try to resize images on another server using the full path it stops working.
Here's the code:
Calls the image resize script:
<?php
$imgName1 = "assets/Barbies.jpg";
$imgName2 = "http://www.themaloneygallery.com/assets/Barbies.jpg";
echo "This works:<br><br><img border=0 src=\"resizeme.php?imgName=$imgName1\"><br><br>";
echo "This doesn't work:<br><br><img border=0 src=\"resizeme.php?imgName=$imgName2\">";
?>
Here's the image resize script being called (resizeme.php):
<?php
$max = 150;
$imgName = $_REQUEST["imgName"];
$size = getimagesize($imgName);
header("Content-type: {$size['mime']}");
$cmd = "convert -resize ".$max."x".$max." ".$imgName." -";
passthru( $cmd );
exit;
?>
Here's the url to the test page on my server:
http://www.kumardesai.com/testcode/resizeimage.php
Any ideas on how to modify the script to get the remote images to resize locally?
Solving this problem would make my life beautiful again. Thanks!