Skip to content

Watermark rotating #817

Description

@RemyBoyer

Hello,

Use case

We'd like to use Imagor to add rotated text watermarks (45°).
Something that would look like that:

Image

We haven't found a way to do that with the text filter.

Working solution

We've managed to do it with a image filter and a server that produces a svg that is already rotated.

The url for a "big" watermark looks like this (the result is the picture above):

http://localhost:8000/unsafe/fit-in/2200x2200/filters:no_upscale():image(/unsafe/full-fit-in/fxf/http://wm-scaled/CFR20240101QSDQSD.svg,center,center,0,soft-light):format(jpeg):quality(80)/http://localhost/file.jpg

And the url for a tiled watermark looks like this:

http://localhost:8000/unsafe/fit-in/2200x2200/filters:no_upscale():image(/unsafe/fit-in/fxf/http://wm-tiled/CFR20240101QSDQSD.svg,repeat,repeat,0,soft-light):format(jpeg):quality(80)/http://localhost/file.jpg

Result file (unreadable watermark here, but the input file is very small compared to the files we'll watermark):
Image

Why this is not ideal

This workaround requires hosting an additional API just to generate the SVG watermark asset.
We would like to avoid that extra moving part if possible.

Possible solutions

We've thought of these solutions and would like to have your opinion, please, on their feasibility:

  1. The text filter could support rotation.
  2. The image filter could support base64 inline data for the svg? We could produce it upfront and provide it in the url.
  3. Alternatively, the POST endpoint could support providing additional images with the multipart body, whose names could be referenced in the url. That should follow the current design.
  4. Any other idea?

Unfortunately, we're not Go developers. But if you accept it, we may provide AI generated PRs for any of the solution above, if we manage to produce them and if they meet our "non Go but experienced developers"' standards of quality 😅

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions