web_master Posted November 13, 2007 Share Posted November 13, 2007 Hi, Ive got a script for a take a watermark on a picture in this case work fine <?php header('content-type: image/jpeg'); $watermark = imagecreatefrompng('zoom.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg('1_photo_thumb.jpg'); imagealphablending($image, true); $size = getimagesize('1_photo_thumb.jpg'); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); print $image; ?> but in this case don't work (differece is only a destination of the pictures) <?php header('content-type: image/jpeg'); $watermark = imagecreatefrompng('media/pict/zoom.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg('media/pict/1_photo_thumb.jpg'); imagealphablending($image, true); $size = getimagesize('media/pict/1_photo_thumb.jpg'); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); print $image; ?> What can I do, to work this script when the pictures is in the other directory? thnx Link to comment https://forums.phpfreaks.com/topic/77126-watermark-pict-destination-problem/ Share on other sites More sharing options...
web_master Posted November 13, 2007 Author Share Posted November 13, 2007 PEOPLE A NEED HELP / its allmost working. Please look the site, where is this watermarked picture, than look it in a source code where is a picture and You will see the table and the other things - but why cant see it in the browser, why can see only the picture? http://www.medovarski.com/product.php Link to comment https://forums.phpfreaks.com/topic/77126-watermark-pict-destination-problem/#findComment-390782 Share on other sites More sharing options...
tippy_102 Posted November 13, 2007 Share Posted November 13, 2007 My guess is that your directory of 'media/pict/' is incorrect. Check the path and see what happens? <?php $filename = "media/pict/zoom.png"; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo"The file $filename does not exist"; } ?> Link to comment https://forums.phpfreaks.com/topic/77126-watermark-pict-destination-problem/#findComment-390991 Share on other sites More sharing options...
atlanta Posted November 13, 2007 Share Posted November 13, 2007 yea make sure you are using the absolute path.. Link to comment https://forums.phpfreaks.com/topic/77126-watermark-pict-destination-problem/#findComment-391001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.