i get an error message (Warning: imagegif(): Unable to open 'ftp://user:pass@ftp/image.jpg' for writing in /thumbnail.php on line 22) when i try to set $imgDest to [url]ftp://user:pass@ftp/[/url]
(ftp server supports passive transfere)
What is it I'm doing wrong?
function createjpegThumbnail($img, $imgDest, $suffix, $newWidth, $quality = 100){
// Open the original image.
$original = imagecreatefromjpeg($img) or die("Error Opening original");
list($width, $height, $type, $attr) = getimagesize($img);
// new height by ratio
$ratio= $height / $width;
$newHeight = $newWidth * $ratio;
// Resample the image.
$tempImg = imagecreatetruecolor($newWidth, $newHeight) or die("Cant create temp image");
imagecopyresized($tempImg, $original, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height) or die("Cant resize copy");
// Create the new file name.
$newNameE = explode(".", $img);
$newName = ‘’. $newNameE[0] .‘’. $suffix .‘.’. $newNameE[1] .‘’;
// Save the image.
imagegif($tempImg, $imgDest.$img, $quality) or die("Cant save image");
// Clean up.
imagedestroy($original);
imagedestroy($tempImg);
return true;
}