Image transforms buffer originals twice and have no decode limit

Open
#3,281 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
aws, azure, csharp

Research direction

Start with MediaTransforms.cs around lines 159 and 179, then trace the full-size decode in SkiaImageProcessor and the AI alt-text path that shares it. The proposal names several coordinated changes, including buffering, single-flight requests, a decode semaphore, and downscaled decoding. Done means concurrent requests for one cold variant decode once and decodes are capped per instance.

Written by the indexing model from the issue text.

Description

performance plugin type:bug

Problem

MediaTransforms.RenderAsync (MediaTransforms.cs:159,179) opens the source twice; on S3 and Azure each open buffers the whole file. The full-size decode in SkiaImageProcessor allocates up to about 200 MB at the default MaxSourcePixels, and nothing caps concurrent decodes or deduplicates requests for the same variant, so a burst of first visits can exhaust memory. The AI alt-text path uses the same code.

Proposal

Use the stored dimensions instead of the first read, spool non-seekable sources once to a temporary file, single-flight per variant, a global decode semaphore, and decode downscaled when the target is much smaller.

Acceptance

  • Concurrent requests for one cold variant decode once
  • Decodes are capped per instance

Found in the code review of 17 Nov 2026 (P2).

Dominant language
C#
Stars
569
Forks
107
Avg merge
2h 49m
Merged PRs (30d)
397

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluentcms/FluentCMS

All issues in fluentcms/FluentCMS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.