Skip to content

scaleImageFromBase64 still decodes the full raster #309

Closed

Description

@fjlopez

Symptom

ImageTransformer.scaleImageFromURL reads with readSubsampled (ImageReadParam.setSourceSubsampling) before scaling. scaleImageFromBase64 still does ImageIO.read on the full decoded bytes, then scales.

The URL path landed in a9349b8c (fix(backend): subsample URL images before scale) so a remote bitmap is not loaded into the heap at full size. The data-URI path was not changed. A large base64 image still allocates the full BufferedImage.

Same code on origin/dev and on 374e1bbe. SVG data URIs already skip raster scaling.

Why this is not on the LTR pointer PR

The URL subsample shipped with the Boot 4.1.1 bump. It is not part of sitmun/sitmun-application-stack#97 (backend 374e1bbe), and that commit does not change scaleImageFromBase64.

Acceptance

  • scaleImageFromBase64 uses the same source subsampling as scaleImageFromURL before scaleImage.
  • ImageTransformerTest.pngDataUriIsStillScaled still passes: a PNG data URI is stored as a scaled PNG of the configured size.
  • SVG data URIs stay stored as image/svg+xml without rasterizing.

Activity

  1. added
    bugSomething isn't working
    confirmedReproduced / accepted defect; exempt from stale bot
    on Oct 20, 2026
  2. added theissue type on Oct 20, 2026
  3. added a commit that references this issue on Oct 21, 2026
    9708f30
  4. fjlopez commented on Oct 21, 2026

    @fjlopez
    ContributorAuthor

    Fixed on dev by #329.

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

    bugSomething isn't workingconfirmedReproduced / accepted defect; exempt from stale bot

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions