Since I mostly want to add watermarks in proportion to the image size, it would be nice to be able to specify the offset in percentages. Since the sizing of the watermark is related to this (#2667184: Scale watermark image with reference to source image) applying this on both offset and the dimensions of the watermark would be great.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lukas von Blarer created an issue. See original summary.

Lukas von Blarer’s picture

Title: Watermark offset » Watermark offset / dimensions in percentages
Issue summary: View changes

Issue created by mistake and corrected accordingly.

Lukas von Blarer’s picture

Title: Watermark offset / dimensions in percentages » Watermark offset and dimensions in percentages
mondrake’s picture

Title: Watermark offset and dimensions in percentages » [PP-1] Watermark offset in percentages
Status: Active » Postponed

I suggest to wait for #2667572: Introduce a Form API element to manage entering information in pixel/percentage to deal with percentage offsets in a proper way. Percentage dimensions is taken care of in #2667184: Scale watermark image with reference to source image.

Lukas von Blarer’s picture

Makes sense. Thank you!

mondrake’s picture

Issue tags: +Media Initiative, +D8Media
mondrake’s picture

Title: [PP-1] Watermark offset in percentages » Watermark offset in percentages
Status: Postponed » Active
mondrake’s picture

Status: Active » Needs review
Issue tags: +Needs upgrade path
FileSize
50.21 KB
22.54 KB

Here's a patch. It builds on top of #2715317: Add "Image mask" effect, since it basically aligns watermark to mask in terms of functionalities - resizing of watermark both horizontal and vertical, both per px or %, and offsets by px or %.

Would require an update function + tests since it changes the schema of the watermark effect.

The last submitted patch, 8: 2667188-8.patch, failed testing.

mondrake’s picture

FileSize
50.47 KB

Missed --binary option for git diff

mondrake’s picture

Title: Watermark offset in percentages » [PP-1] Watermark offset in percentages
Status: Needs review » Postponed
Related issues: +#2715317: Add "Image mask" effect
mondrake’s picture

Title: [PP-1] Watermark offset in percentages » Watermark offset in percentages
Status: Postponed » Needs review
Issue tags: -Needs upgrade path
FileSize
29.11 KB

Image mask is in, unpostponed. Added post-update for the watermark effect + test.

Status: Needs review » Needs work

The last submitted patch, 12: 2667188-12.patch, failed testing.

mondrake’s picture

Status: Needs work » Needs review
FileSize
2.52 KB
29.87 KB
mondrake’s picture

FileSize
1.23 KB
1.23 KB

X and Y offsets can be negative.

Status: Needs review » Needs work

The last submitted patch, 15: 2667188-15.patch, failed testing.

mondrake’s picture

Status: Needs work » Needs review
FileSize
29.5 KB
mondrake’s picture

Status: Needs review » Needs work

NW for the 7.1 failures

mondrake’s picture

Status: Needs work » Needs review
FileSize
2 KB
29.57 KB

Fix of 7.1 failures

  • mondrake committed 801ec4c on 8.x-1.x
    Issue #2667188 by mondrake: Watermark offset in percentages
    
mondrake’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.