Page 1 of 1

Mod to adjust watermark transparency

Posted: 09 Apr 2009, 02:36
by anij21
This mod will allow your watermarks to be faded to a percentage 100% is the same the current way it works.
I use 15% to give a ghostly watermark.

Find: administrator/components/com_phocagallery/helpers/phocagallery.php
Find:
// Watermark
if ($fileWatermark != '') {
ImageCopy($image2,$waterImage1,$locationX,$locationY,0,0,$wW,$hW);
}
// End Watermark

Replace with:
// Watermark
if ($fileWatermark != '') {
ImageCopymerge($image2,$waterImage1,$locationX,$locationY,0,0,$wW,$hW, 15);
}
// End Watermark

The final parameter is now the percentage of the watermark picture that you see.
It should also be easy to add into the parameter list as a preset, if I get time I'll have a look on how to do it.
An1j21

Re: Mod to adjust watermark transparency

Posted: 09 Apr 2009, 03:10
by anij21
To add a transparency setting to the parameters

Find: administrator/components/com_phocagallery/helpers/phocagallery.php
Find:

// Watermark
if ($fileWatermark != '') {
ImageCopymerge($image2,$waterImage1,$locationX,$locationY,0,0,$wW,$hW, 15);
}
// End Watermark

Replace with:
// Watermark
if ($fileWatermark != '') {
$Wtransparency = $params->get( 'Wtransparency', 15 );
ImageCopymerge($image2,$waterImage1,$locationX,$locationY,0,0,$wW,$hW, $Wtransparency);
}
// End Watermark

Find:
administrator/components/com_phocagallery/config.xml
Find:
<param name="watermark_position_y" type="list" default="middle" label="Y-Position of Watermark" description="Y-Position of Watermark DESC">
<option value="top">top</option>
<option value="middle">middle</option>
<option value="bottom">bottom</option>
</param>

Add after:
<param name="Wtransparency" type="phocatext" size="3" default="15" label="Watermark transparency" description="Watermark transparency" />

Don't forget to rebuild all the thumbnails after.
If you can ssh in then in the folder /images/phocagallery use the following command line to remove ALL thumbnails fast.
find -name "*phoca_thumb*" -print0|xargs -0 rm

Thanks Jan for a brilliant component :)

Re: Mod to adjust watermark transparency

Posted: 15 Apr 2009, 21:02
by Jan
Great, thank you for this improvement, Jan