1
Mods & Plugins (Releases & Support) / Re: [Mod] Image Annotation (Watermark)
« on: August 15, 2007, 10:16:02 AM »
HowTo use ImageMagick (guess it's an bug fix)
-----------------------------------------------------------------
Some people (including myself as well) reported that the ImageMagick module doesn't work for this mod! Well, I searched in the internet and found an additional ImageMagick command to overlay two images. http://www.imagemagick.org/Usage/annotating/#wmark_image
Instead of using the ImageMagick program called "convert" we'll use the program "composite"!
For me it worked fine! Hope one someone's else page as well!
PS:
Set the path to ImageMagick in the ControlPanel like :
/usr/bin/
At the moment this fix doesn't support image positioning by pixels! You can just set the position with the horizontal and vertical alignment like:
Vertical: middle
Horizontal: left
Position of the watermark image: In the west of the orig. image
Search for:
Add directly under:
Search for:
Replace the $command line, which is directly under the search result, with the following $command
-----------------------------------------------------------------
Some people (including myself as well) reported that the ImageMagick module doesn't work for this mod! Well, I searched in the internet and found an additional ImageMagick command to overlay two images. http://www.imagemagick.org/Usage/annotating/#wmark_image
Instead of using the ImageMagick program called "convert" we'll use the program "composite"!
For me it worked fine! Hope one someone's else page as well!
PS:
Set the path to ImageMagick in the ControlPanel like :
/usr/bin/
At the moment this fix doesn't support image positioning by pixels! You can just set the position with the horizontal and vertical alignment like:
Vertical: middle
Horizontal: left
Position of the watermark image: In the west of the orig. image
Search for:
Code: [Select]
}
else {
$ann_box = @getimagesize($ann_embed_image);
$ann_text_width=$ann_box[0]; $ann_text_height=$ann_box[1];
switch ($horisontal) {
case "left" : $h_offset = $ann_left_offset; break;
case "center" : $h_offset = (($isz[0]/2) - ($ann_text_width/2)); break;
case "right" : $h_offset = ($isz[0] - $ann_text_width - $ann_right_offset); break;
}
switch ($vertical) {
case "top" : $v_offset = $ann_top_offset; break;
case "middle" : $v_offset = (($isz[1]/2) - ($ann_text_height/2)); break;
case "bottom" : $v_offset = $isz[1] - $ann_text_height - $ann_bottom_offset; break;
}
Add directly under:
Code: [Select]
if ($ann_tool == "im"){
if ($horisontal == "left" && $vertical == "top"){
$watermarkImagePos = "NorthWest";
}
if ($horisontal == "left" && $vertical == "middle"){
$watermarkImagePos = "West";
}
if ($horisontal == "left" && $vertical == "bottom"){
$watermarkImagePos = "SouthWest";
}
if ($horisontal == "center" && $vertical == "top"){
$watermarkImagePos = "North";
}
if ($horisontal == "center" && $vertical == "middle"){
$watermarkImagePos = "Center";
}
if ($horisontal == "center" && $vertical == "bottom"){
$watermarkImagePos = "South";
}
if ($horisontal == "right" && $vertical == "top"){
$watermarkImagePos = "NorthEast";
}
if ($horisontal == "right" && $vertical == "middle"){
$watermarkImagePos = "East";
}
if ($horisontal == "right" && $vertical == "bottom"){
$watermarkImagePos = "SouthEast";
}
}
Search for:
Code: [Select]
if ($ann_tool == "im") {
if ($use_image) {
Replace the $command line, which is directly under the search result, with the following $command
Code: [Select]
$command = $convert_options['convert_path']."/composite -dissolve $annotation_embed_image_opacity% -gravity $watermarkImagePos \"$ann_embed_image\" \"$ann_src\" \"$ann_dest\"";