lupinia / awi

Full Lupinia/Awi website, built with Django
https://www.lupinia.net/
2 stars 1 forks source link

Watermark Sunset images after resizing, not before #87

Closed lupinia closed 1 year ago

lupinia commented 1 year ago

I discovered recently that the new image assets for Twitter and OpenGraph metadata (added to support #61, implemented in https://github.com/lupinia/awi/commit/0a47b3d708eb8c064402fc9f31e2eb5a7bd4cc72) do not properly contain watermarks. This appears to be because they're getting cut off. I checked the order of operations in sunset.models.image, and the watermark is the first thing being applied, before any resizing. Since setting exact to True causes the build_resize process to crop the image if its aspect ratio doesn't match, this cuts off the watermark.

I'm sure this order of operations made sense at the time that I wrote it, but it's completely backward: Watermarking needs to be the last step in the process, not the first.