Watermark alignement calculation is broken for images higher than wide
When using a watermark that is higher than wide, the computation of width is wrong and result in an odd result: the watermark alignement set as centered seems to align to the left side of the watermark.
Attached are 2 files showing the hasselblade.svg watermark in use: what should be the result, and what the result is.
After some investigation, it seems that this is due to the computation of the width based on the ratio being wrong.
#1 Updated by David Morel about 7 years ago
If that seems fine, I can send a pull request.
#4 Updated by David Morel about 7 years ago
I can confirm that selecting upper-left corner in alignment is will display a correct render, but this is because the scale is the same as the image, and that this is 100% scale, it still is not the intended behavior
Centered should not put the watermark over the right part of the image, it should be centered.
Take the time to look at the patch suggested, you can see that the computation of svg_width contains a mistake. I printed the values to find out were the issue was, and width had nothing to do with the actual ratio of the image, which make sense based on the inverted divison.