Hi,
I am having trouble resizing an image when I use the full "http://www.mysite.com/somepicture.jpg"... I just switched servers so I am thinking it might be a setting in PHP i need to change? if I just use "somepicture.jpg" on this new server it works without a problem. Otherwise it just hangs forever.
Here is the script (copied from php.net for example of what i mean):
<?php
// The file
$filename = 'http://www.mysite.com/somepicture.jpg';
$percent = 0.5;
// Set a maximum height and width
$width = 200;
$height = 200;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
?>
again this works fine if i leave out the full http but otherwise it hangs... this did work on my other server with http and all which is why I am confused. Any ideas?
Thanks