imazen / imazen/imageflow-server

ImageflowMiddlewareOptions.AddWatermark() - Removal

Open
#13 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
316
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I need to dynamically generate watermark configurations on the fly, **conditionally depending** on the current image being requested. I am using the "AddRewriteHandler" to implement my conditional logic, which might involve some DB calls. While I can ADD one without an issue, I can not remove that watermark configuration or replace it, which may be necessary in case the dynamic conditions change on the next call (in addition to cleanup). In this project's current state, is there a way to accomplish this? It seems that the ImageflowMiddlewareOptions.NamedWatermarks is a IReadOnlyCollection, and therefore can't be modified directly. While I can filter down to the previously added NamedWatermark object, Now, even though WatermarkOptions is GET only, I can use its methods to modify the state of the object, but even then I wouldn't know what all was set previously and what needs to be reset.

For me, the simplest solution would be to give us the ability to clean up these NamedWatermarks so that we can just remove and add as necessary.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining ImageflowMiddlewareOptions.NamedWatermarks, NamedWatermark, and WatermarkOptions, especially the AddRewriteHandler path described in the issue. Determine how dynamically added configurations can be removed or replaced without leaving stale state; done means callers can clean up or update a named watermark safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.