sayndesyn Posted January 19, 2007 Share Posted January 19, 2007 Hi, Very appreciative of the help I received on my other problem. Sadly my code skills are lacking and I am just trying to get this site running because it is down right now. After a thumbnail page (which the problem was solved in GD-JPEG snafu thread) you link to a page which links to the larger image that is created and placed with a watermark on it via the following code. I am receiving the following errors.imagecopyresampled(): supplied argument is not a valid Image resource in <b>/home/10434/domains/viewsfromabove.com/html/vfaPublishing/gallery/Augusta/watermark.php</b> on line <b>12</b><br /><br /><b>Warning</b>: imagejpeg(): supplied argument is not a valid Image resource in <b>/home/10434/domains/viewsfromabove.com/html/vfaPublishing/gallery/Augusta/watermark.php</b> on line <b>14</b><br /><br /><b>Warning</b>: imagedestroy(): supplied argument is not a valid Image resource in <b>/home/10434/domains/viewsfromabove.com/html/vfaPublishing/gallery/Augusta/watermark.php</b> on line <b>15</b><br />It must be a simple fix because the code worked fine on another server, but like I mentioned my code skills are lacking.[code]<? header('content-type: image/jpeg'); $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($f); $size = getimagesize($f); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; //imagecopyresampled($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $watermark_width, $watermark_height); imagecopyresampled($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?>[/code]In the display page everything is being transmitted right from the mysql table properly, the link to the image looks like.<img src="watermark.php?f=Augusta Mental Health Institute Augusta Maine_002.JPG" border="0" class="img">Any help or direction would be appreciated. The actual links to the area I am testing the changes on is.http://www.viewsfromabove.com/vfaPublishing/gallery/Augusta/display.php?cat_id=1&page=1Thanks, Sam Link to comment https://forums.phpfreaks.com/topic/34830-gd-library-watermark-code-problem/ Share on other sites More sharing options...
sayndesyn Posted January 19, 2007 Author Share Posted January 19, 2007 I thought I might need to add something like this at the beginning...$image = $_GET['image'];but that didn't change anything. Like I said, I am a php NOOb Link to comment https://forums.phpfreaks.com/topic/34830-gd-library-watermark-code-problem/#findComment-164504 Share on other sites More sharing options...
sayndesyn Posted January 19, 2007 Author Share Posted January 19, 2007 Nevermind, I ended up changing the register globals, even though it is a security no no... Link to comment https://forums.phpfreaks.com/topic/34830-gd-library-watermark-code-problem/#findComment-164516 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.