Skip to content

Resolved #5372 where a watermark image manipulation contaminated the shared source temp file, watermarking auto-generated thumbnails - #5373

Merged
bryannielsen merged 1 commit into
ExpressionEngine:7.devfrom
creativearc-paul:patch-1
Sep 18, 2026
Merged

bryannielsen merged 1 commit into
ExpressionEngine:7.devfrom
creativearc-paul:patch-1

Conversation

@creativearc-paul

Copy link
Copy Markdown
Contributor

When an upload directory has an image manipulation with a watermark whose target dimensions exceed the uploaded image in both dimensions, create_thumb() aliases $config['new_image'] onto the single shared temp copy of the source (Filemanager.php:1322). create_watermark() sets only source_image and writes in place, so the watermark is burned into the temp file that every subsequent manipulation resizes from — including the thumbs entry appended last, which hardcodes watermark_id => 0.

Result: _thumbs/ and any no-watermark manipulation that also takes the copy-rather-than-upsize path come out watermarked, while the original upload is untouched — which is what makes it easy to miss.

This copies into the manipulation's own temp file instead, preserving the existing "copy rather than upsize" behaviour without mutating the shared source.

Verified on a production install: 2,260 of 2,979 images in one upload directory were affected (watermark manipulations at 2000x2000, masters ranging from 200x200 up). After the fix, _thumbs is clean, a no-watermark copy-path manipulation is byte-identical to its source, and each watermark manipulation contains only its own watermark.

Note for reproduction: this requires a fresh upload. Re-syncing an existing file masks it, because pre-existing manipulations are skipped when $missing_only = true, so nothing contaminates the shared temp copy.

Resolves #5372

When a manipulation's target dimensions exceed the source image in both dimensions, create_thumb() aliased $config['new_image'] onto the single shared temp copy of the source. create_watermark() writes in place, so the watermark was burned into the source that every later manipulation resized from - including the 'thumbs' entry appended last, which sets watermark_id => 0 and should never be watermarked.

Copy into the manipulation's own temp file instead. This preserves the existing "copy rather than upsize" behaviour while leaving the shared source untouched.
@CLAassistant

CLAassistant commented Aug 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@TomJaeger TomJaeger modified the milestones: 7.5.27, 7.5.28 Sep 15, 2026
@bryannielsen bryannielsen added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Sep 18, 2026
@bryannielsen
bryannielsen merged commit 5be9c2f into ExpressionEngine:7.dev Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create_thumb(): a watermark manipulation contaminates the shared source temp file, watermarking the auto-generated _thumbs thumbnail

4 participants

Sponsor
SponsoredKunjungi sekarang
Promo