Scaling the watermark?
-
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!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Scaling the watermark?’ is closed to new replies.