phpQuestioner Posted November 7, 2007 Share Posted November 7, 2007 Ok - So I have a script that watermarks an image; it adds a transparent gif over my base image. I also have a script to resize my image. But here is where the problem comes in; these are two different scripts - none of the code will interconnect (variable wise - that is), so I am having a problem trying to piece together a PHP GD Image code that will create a watermark and will then be resized. Below is my code for resizing my image, but from there - I know I need to use imagecreategif somewhere and imagecopy somewhere; but where, I do not know. <?php $pw = $_GET['pw']; $ph = $_GET['ph']; $percent1 = $pw; $percent2 = $ph; // Content type header('Content-type: image/jpeg'); // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = $width - $percent1; $newheight = $height - $percent2; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); ?> Quote Link to comment Share on other sites More sharing options...
joma Posted December 17, 2007 Share Posted December 17, 2007 what was your outcome to this ??? 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.