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 Quote Link to comment 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 Quote Link to comment 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"; } ?> Quote Link to comment 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.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.