#########################################
# Watermark Code #
#########################################
// Set a maximum height and width
$width = 400;
$height = 400;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($fullpath);
if ($width_orig >= 400 || $height_orig >= 400)
{
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
}
else
{
$width = $width_orig;
$height = $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($fullpath);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
$picture = $image_p;
$logo = "images/watermark.jpg";
$logosize = getimagesize(rtrim($logo));
$logox = $logosize[0];
$logoy = $logosize[1];
$pictureim = $picture;
$logoim = imagecreatefromjpeg($logo);
imagecopy ( $pictureim, $logoim, imagesx( $pictureim ) - imagesx( $logoim ) - 5, imagesy( $pictureim ) - imagesy( $logoim ) - 5, 0, 0, imagesx( $logoim ), imagesy( $logoim ) );
// Output
imagejpeg($pictureim, $targetfile, 75);
imagedestroy($image);
imagedestroy($image_p);
#########################################
# End Watermark Code #
#########################################
When i run that script i get this error
The image “http://hotfaceoff.com/mypicture2.php” cannot be displayed, because it contains errors.
anyone have any ideas? This script also resizes