Repository navigation
Conversation
jayleaton
force-pushed
the
scratch/ctt-114-combined
branch
from
October 23, 2026 10:56
448cf29 to
54d6c87
Compare
Adds packages/storage (S3 client over net/http + SigV4, no SDK), packages/storage/safefetch (user-URL fetch that checks every dialled IP, redirect hop included, so DNS rebinding fails) and packages/storage/imaging (pure-Go JPEG/PNG/GIF/WebP/AVIF decode, EXIF orientation, fit to 2048 px, re-encode to WebP). Off unless STORAGE_S3_ENDPOINT/BUCKET/ACCESS_KEY_ID/SECRET_ACCESS_KEY are set (live secrets, all or none, probed at boot). One example behind the layers: ImageService with ObjectStore/ImageFetcher/ImageCodec ports and /api/core/v1/images (upload, import by URL, get, delete), mounted only when storage is on. The SSRF address and URL rules live in services (PublicAddr, FetchURLAllowed) and are table-tested there. New dependencies: gen2brain/webp and gen2brain/avif (libwebp transpiled to Go, libavif under wazero; the only pure-Go WebP encoder and AVIF decoder) and golang.org/x/image (resizing). Builds need -tags nodynamic to stay static: make build and the Dockerfile pass it, and the image build fails without it. Source: jayleaton/auto-visuals#9 and #26 (generic parts only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…98 MB x/image/draw's CatmullRom.Scale keeps the whole horizontally scaled image (target width x source height x 32 bytes): 198 MB for a 12 MP photo, 396 MB for 48 MP, and the server held about 540 MB after a few uploads. resize does the same separable Catmull-Rom (same weights, same 16-bit premultiplied arithmetic, same rounding) one band of output rows at a time, scaling only the source rows a band reads, support rows included, so the output is identical byte for byte and bands leave no seams. Peak RSS on the real server: 12 MP upload 567 -> 179 MB, 48 MP 591 -> 218 MB, two 12 MP at once 528 -> 266 MB; the stored WebP is byte-identical. golang.org/x/image is no longer needed (image/draw from the standard library covers the copy). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jayleaton
force-pushed
the
scratch/ctt-114-combined
branch
from
October 23, 2026 11:07
54d6c87 to
1f96fde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scratch: #114's commits on top of the fix, to prove the test budget passes. Closed and deleted afterwards.