Skip to content

Image rescale cache reuses results from a different size limit #6085

Closed

Description

@Afloat16

Problem

The ordinary rescaleImage cache uses only base64 content as its key. Reusing an image after maxDim changes returns dimensions from the previous policy; a cached no-op at a larger limit also suppresses required resizing at a smaller limit.

Reproduction

At master 541cf26, resize the same large image at 1600 then 800, and in reverse order. A 1601-pixel BMP cached as a low-benefit no-op at 1600 also remains unscaled at 800. Decoding the output proves the wrong dimensions. The base has 23 passed / 3 failed.

Expected

Include MIME and maxDim with the image content in the ordinary rescale cache key. Same-policy requests still reuse their result. Forced shedding retains its existing independent behavior.

Prior work

Screened all 3,221 cached upstream PRs. #3425 introduces preprocessing, #3565 covers settings, and #3706 keys forced shedding by dimension. This fixes the separate ordinary rescale cache, including negative results. Previous Afloat16 PRs #6046–#6055 are excluded.

Activity

  1. ranxianglei commented on Nov 12, 2026

    @ranxianglei
    Owner

    Fixed in batch PR #6439 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions