Filter Watermark - allow h_ratio and w_ratio as a real number
Author: asokaniCreated Nov 13, 2024Updated Apr 5, 2025
Labelsdo-not-reap
The existing "watermark" filter allows you to resize an image to be applied over another.
This resizing can be specified using the w_ratio and h_ratio parameters. Unfortunately, these parameters are only integers. So if I want to apply a watermark of width 57px to a 600px wide image, I can't. I have to choose either 60px width (w_ratio 10%) or 54px width (w_ratio 9%).
It would be enough to allow the w_ratio and h_ratio parameters as real numbers and resizing would be exact (57px is w_ratio 9.5%).
I've already made a patch for this, which is waiting as a pull request here: https://github.com/thumbor/thumbor/pull/1701
Source: thumbor/thumbor