4 Commits
Author SHA1 Message Date
kolaente 27ec08bb03 fix(images): limit the side length of decoded images
Images longer than MaxSide (65535) pixels on either side are now rejected
before decoding, like images over the pixel limit.

Attachments with such images are still stored; only their preview is not
generated. Project backgrounds and avatars reject them with the existing
image too large error.
2026-11-05 15:42:45 +01:00
kolaente c8b816bdfa refactor(imageutils)!: answer every busy decode with code 4037
Address review decision: previews (4037) and other decodes (4040) had two
busy errors for one condition. ErrDecodeBusy now carries 4037 and the
preview-only error is gone.
2026-10-20 23:05:30 +02:00
kolaente f930d895c9 refactor(imageutils): move pixel-weighted decode semaphore
Attachment previews now decode through imageutils.Decode, which holds an
image's pixels against one process-wide budget until the caller is done
with the decoded image. Other decode sites move onto it next.
2026-10-20 23:05:30 +02:00
kolaente 40d95182fc fix(images): bound decode and resize dimensions
Decoding now validates image dimensions before allocating pixels
(imaging.Fit replaces unbounded Resize so neither side can blow up),
backgrounds decode once and reuse the image for the blur hash, and
DownloadImage is bounded at the configured max file size. Small sources
now keep their native size (Fit does not upscale); the frontend scales
via CSS.
2026-08-31 18:37:03 +02:00