--- image.gd.inc.orig	2007-09-07 09:09:01.000000000 +0200
+++ image.gd.inc	2007-09-07 09:10:24.000000000 +0200
@@ -63,6 +63,32 @@ function image_gd_check_settings() {
 }
 
 /**
+ * Watermark a source image with a watermark image using GD.
+ */
+function image_gd_watermark( $source, $watermark, $destination, $x, $y ) {
+  $info = image_get_info($source);
+  $wm_info = image_get_info( $watermark);
+  if ( !$info || !$wm_info) {
+    drupal_set_message( 'wm: ' . $watermark);
+    return FALSE;
+  }
+
+  $image = image_gd_open( $source, $info['extension']);
+  $wm_image = image_gd_open( $watermark, $wm_info['extension']);
+  
+  imagecopy( $image, $wm_image, $x, $y, 0, 0, $wm_info['width'], $wm_info['height'] );
+  
+  $result = image_gd_close( $image, $destination, $info['extension']);
+  
+  imagedestroy($image);
+  imagedestroy($wm_image);
+  
+  return $result;
+  
+}
+
+
+/**
  * Scale an image to the specified size using GD.
  */
 function image_gd_resize($source, $destination, $width, $height) {
