Welcome Guest, Not a member yet? Register   Sign In
Watermark scaling using Image Library watermarking
#1

[eluser]Unknown[/eluser]
So, I created a watermark image in Photoshop, with the drop shadow & transparency and everything, since I wasn't really liking how Image Library was doing the text watermarking. But, I wanted to have it dynamically re-size the watermark image depending on the size of the image I was trying to watermark.

So, I dived into the Image Library, found what I was looking for. Attached is the patch, I add 1 config parameter, 'wm_scale' which is a boolean, default false, that if true will attempt to scale the watermark image and center it (just realized, basically ignores the 'wm_vrt_alignment' & 'wm_hor_alignment' & 'wm_hor_offset' & 'wm_vrt_offset' parameters). I'm not using the 'wm_opacity' at all, so I haven't fully tested that code path (the else starting on line 1021 in my patched file, otherwise the else starting on line 953 in v2.0.2).

Probably more info I should put, but I'm tired and work comes tomorrow. First time I've done anything deep(ish) in CI core code. Any constructive feedback is appreciated and welcomed.




Theme © iAndrew 2016 - Forum software by © MyBB