Here are the errors im getting:
Warning: copy(http://www.londondigitalone.com/mailfuse/templates/RemaxUltimateRealty/RichardMyers/RemaxUltimateRealty_RichardMyersthumb.jpg_backup.jpg): failed to open stream: HTTP wrapper does not support writeable connections. in /home/ziggy/public_html/mailfuse/templates/RemaxUltimateRealty/RichardMyers/functions.php on line 11
Warning: getimagesize(http://www.londondigitalone.com/mailfuse/templates/RemaxUltimateRealty/RichardMyers/RemaxUltimateRealty_RichardMyersthumb.jpg_backup.jpg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/ziggy/public_html/mailfuse/templates/RemaxUltimateRealty/RichardMyers/functions.php on line 12
ok here is my code:
//PURPOSE: creates a resized image in the same directory that the images source is in
//FIELDS: $IMAGE_SOURCE - Location of image to be resized
// $THUMB_X - Width of output picture
// $THUMB_Y - Height of output picture
// $OUTPUT_FILE - Name to call file
//EXAMPLE CODE: Client Login V1.0
//KEYWORD: images, resize, resize images, jpg, create
function createResizedImage($IMAGE_SOURCE,$THUMB_X,$THUMB_Y,$OUTPUT_FILE){
$BACKUP_FILE = $OUTPUT_FILE . "_backup.jpg";
copy($IMAGE_SOURCE,$BACKUP_FILE);
$IMAGE_PROPERTIES = getimagesize($BACKUP_FILE);
if (!$IMAGE_PROPERTIES[2] == 2) {
return(0);
} else {
$SRC_IMAGE = ImageCreateFromJPEG($BACKUP_FILE);
$SRC_X = ImageSX($SRC_IMAGE);
$SRC_Y = ImageSY($SRC_IMAGE);
if (($THUMB_Y == "0") && ($THUMB_X == "0")) {
return(0);
} elseif ($THUMB_Y == "0") {
$SCALEX = $THUMB_X/($SRC_X-1);
$THUMB_Y = $SRC_Y*$SCALEX;
} elseif ($THUMB_X == "0") {
$SCALEY = $THUMB_Y/($SRC_Y-1);
$THUMB_X = $SRC_X*$SCALEY;
}
$THUMB_X = (int)($THUMB_X);
$THUMB_Y = (int)($THUMB_Y);
$DEST_IMAGE = imagecreatetruecolor($THUMB_X, $THUMB_Y);
unlink($BACKUP_FILE);
if (!imagecopyresized($DEST_IMAGE, $SRC_IMAGE, 0, 0, 0, 0, $THUMB_X, $THUMB_Y, $SRC_X, $SRC_Y)) {
imagedestroy($SRC_IMAGE);
imagedestroy($DEST_IMAGE);
return(0);
} else {
imagedestroy($SRC_IMAGE);
if (ImageJPEG($DEST_IMAGE,$OUTPUT_FILE)) {
imagedestroy($DEST_IMAGE);
return(1);
}
imagedestroy($DEST_IMAGE);
}
return(0);
}
}
can anyone help me find out what is wrong with my code?