hello simeon
try this
Don't forget to force GD2 in myalbum preferencesIn the file modules/myalbum/include/functions.php at line 350 you will find the following code which is the end of the fonction : function myalbum_modify_photo_by_gd( $src_path , $dst_path )
imagedestroy( $src_img ) ;
if( ! is_readable( $dst_path ) ) {
// didn't exec convert, rename it.
@rename( $src_path , $dst_path ) ;
return 2 ;
} else {
@unlink( $src_path ) ;
return 1 ;
}
replace it with the following code.
imagedestroy( $src_img ) ;
if( ! is_readable( $dst_path ) ) {
// didn't exec convert, rename it.
@rename( $src_path , $dst_path ) ;
[color=FF0000]$ret = 2 ;[/color]
} else {
@unlink( $src_path ) ;
[color=FF0000]$ret = 1 ;[/color]
}
[color=FF0000]$src = imagecreatefrompng(XOOPS_ROOT_PATH."/modules/myalbum/images/watermark.png");
$dst = imagecreatefromjpeg($dst_path);
$width_src = imagesx($src);
$height_src = imagesy($src);
$width_dst = imagesx($dst);
$height_dst = imagesy($dst);
$dst_x = $width_dst - $width_src;
$dst_y = $height_dst - $height_src;
imagecopymerge($dst, $src, $dst_x, $dst_y, 0, 0, $width_src, $height_src, 60);
imagejpeg( $dst , $dst_path ) ;
return $ret ;[/color]
Now all you have to do is a transparent png watermark which will be named watermark.png and located in modules/myalbum/images.
If you want the watermark to work also when you do a grouped upload then you must add some more code
in the file modules/myalbum/admin/batch.php you must add line 100 the following red code :
myalbum_create_thumb( "$photos_dir/$lid.$ext" , $lid , $ext ) ;
[color=CC0000]$src = imagecreatefrompng(XOOPS_ROOT_PATH."/modules/myalbum/images/watermark.png");
$dst = imagecreatefromjpeg("$photos_dir/$lid.$ext");
$width_src = imagesx($src);
$height_src = imagesy($src);
$width_dst = imagesx($dst);
$height_dst = imagesy($dst);
$dst_x = $width_dst - $width_src;
$dst_y = $height_dst - $height_src;
imagecopymerge($dst, $src, $dst_x, $dst_y, 0, 0, $width_src, $height_src, 60);
imagejpeg( $dst , "$photos_dir/$lid.$ext" ) ;[/color]
$xoopsDB->query( "INSERT INTO $table_text SET lid='$lid', description='$desc4save'" ) ;
The problem with this last code is that it doesn't respect the class system of the module so if you try to use another library than GD2, you could then have some problems if you don't remove this code first.Edldp