Skip to content

feat(watermark): Add custom watermark and logging for image processing#22

Merged
nakamuraos merged 4 commits intomainfrom
feat/wm-expand
Apr 2, 2026
Merged

feat(watermark): Add custom watermark and logging for image processing#22
nakamuraos merged 4 commits intomainfrom
feat/wm-expand

Conversation

@nakamuraos
Copy link
Copy Markdown
Contributor

This pull request introduces extended watermark support to the image transformation pipeline, focusing on new parameters for both image and text watermarks, and adds improved tracing for image decoding and encoding operations. The changes include new fields and parsing logic for watermark options, comprehensive tests, and enhanced logging for easier debugging.

Watermark Parameter Extensions

  • Added new fields to TransformParams to support watermark opacity, position, offsets, scale, and text watermark options (content, color, size, font). These are now parsed from path, query, and key-value sources. (src/modules/proxy/dto/params.rs) [1] [2] [3] [4]
  • Updated logic to consider text watermarks (wmt) as image transforms, ensuring they are handled consistently with image watermarks. (src/modules/proxy/dto/params.rs) [1] [2]

Testing

  • Added comprehensive unit tests to verify the default values, parsing, and transform detection for all new watermark parameters. (src/modules/proxy/dto/params.rs)

Tracing and Debug Logging

  • Introduced detailed tracing::trace! and tracing::debug! statements throughout image decoding and encoding code paths for formats including SVG, PSD, HEIC, PDF, AVIF, JPEG XL, and GIF. This will help with debugging and performance monitoring. (src/modules/transform/ops/decode.rs, src/modules/transform/ops/encode.rs, src/modules/transform/ops/gif_anim.rs) [1] [2] [3] [4] [5] [6] [7] [8] [9]

Dependency Updates

  • Added the ab_glyph crate to Cargo.toml, likely as a prerequisite for future text watermark rendering. (Cargo.toml)

These changes lay the groundwork for advanced watermarking features and improve observability in image processing operations.

@nakamuraos nakamuraos merged commit 1c05f09 into main Apr 2, 2026
6 checks passed
@nakamuraos nakamuraos deleted the feat/wm-expand branch April 2, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant