• How to set a Proportionate Text Watermark
    The method involves calculating a font size which is based on the width of the image.
    You need to make a couple of simple updates to functions.php in the nextgen admin folder.
    Here are the changes:
    1. Find function set_watermark($image)
    2. Immediately after these statements:

    if ( !is_object($image) )
    return __('Object didn\'t contain correct data','nggallery');

    3. Insert these 2 statements:

    $imgWidth = $image->meta_data['width'];
    $fontSize = $imgWidth / 18;

    4. Look for this statement:

    $file->watermarkCreateText($ngg->options['wmColor'], $ngg->options['wmFont'], $ngg->options['wmSize'], $ngg->options['wmOpaque']);

    5. Replace with this statement:

    $file->watermarkCreateText($ngg->options['wmColor'], $ngg->options['wmFont'], $fontSize, $ngg->options['wmOpaque']);

    This means that the font size in the nextgen settings page for the text watermark is ignored.
    Note: In calculating $fontSize I’ve used 18 as the divisor as this value works best with my particular watermark text string and preferred font. You will need to experiment with different values to find the one that works for you.
    Regards, Tom O’Dea
    Melbourne, Australia

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

  • The topic ‘How to set a Proportionate Text Watermark’ is closed to new replies.