Support » Plugin: Easy Watermark » Scaling the watermark?

  • Resolved Alex

    (@alexiarna)


    Hi there,

    I noticed that watermark is bigger on smaler images (like thumbs) than on bigger ones – because the watermark absolute size remains the same for all images.

    Now, can we change the watermark size to be in percent? Or somehow variable wth the image size?

    For text I figured out the code below, but for images seems pretty complex for me, can you help with this?

    My code for scaling the text is (at line 621 in EasyWatermark.php):

    // Compute relative text size
    // Standards: imageHeight = 1500 & textSize = 32
    // RELtextSize = (imageHeight / 1500) * ABStextSize
    // This way the font size will be scalled comparing to a 1500 px height image!
    $absTextSize = $settings['size'];
    $relTextSize = ( $imageHeight / 1500 ) * $absTextSize;
    //... but not if text size gets too small (ex. for preview)
    if ($relTextSize < 1) { $relTextSize = $absTextSize; }
    
    imagettftext($this->outputImage,
    $relTextSize,
    $settings['angle'],
    $offsetX - $deltaX, $offsetY - $deltaY,
    $color,
    $settings['font'],
    $this->text);

    Thanks!

    http://wordpress.org/plugins/easy-watermark/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author szaleq

    (@szaleq)

    Hi Alex,

    Actually there is an option to scale image watermark, you can set this on the watermark settings page (Settings > Easy Watermark > “Image” tab, just below the alignment settings). Watermark can be scaled to width or height. There is also an option to scale watermark only for images smaller than the watermark image. Hope it will be useful, please tell me if you found this settings and can use it.

    The text scaling option is missing now in the original plugin, but it will be added in the next release.

    Alex

    (@alexiarna)

    Yes, I found it, thank you!
    Now I’ll craft a composed scaling watermark using author name and site logo for a photography colaborative website, wish me luck at this one, ok?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Scaling the watermark?’ is closed to new replies.