Repository navigation
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Importing an image larger than a browser canvas can hold, for example a 17000x17000 PNG, appeared to work: the size badge showed the new dimensions, but the 2D preview stayed blank and the app stayed unresponsive for minutes. CanvasPreview copies the image into canvases at full size, and browsers silently refuse canvases over 268,435,456 pixels (16384x16384) in Chromium, the WebView2 desktop app and WebKit, or with a side over 32,767 pixels in Firefox. The refused canvases stay blank instead of throwing, so the rest of the pipeline kept working against unusable canvases (vycdev#125). useImageImport now reads the decoded size before closing the image and refuses anything outside both limits, through the same path as unreadable files: the object URL is revoked, nothing is pushed to image history, the swatches are left alone, and the dismissible import notice explains the problem. The check lives in the main import rather than validateImageFile because the Stack Matrix photo picker also uses that helper and draws photos at no more than 1200 px, so very large photos still work there. - src/lib/imageFile.ts: add MAX_IMAGE_SIDE, MAX_SQUARE_IMAGE_SIDE, MAX_IMAGE_PIXELS and fitsImageCanvasLimits, with the per-engine limits documented. - useImageImport: new 'tooLarge' error kind carrying the file name, the image size and whether the current image was kept, so the notice follows language changes like the existing kinds. - App: build the notice text in a small helper instead of a nested ternary. Every translation key stays a literal for check:i18n. - Two new strings in all 12 locales name the image size and the 16384x16384 limit, with and without the "current image was kept" sentence. - Loading Images docs, in all 12 languages, describe the limits. - Unreleased changelog entry under Fixed. Tests: unit coverage of the limits at and just past both boundaries, and a @smoke e2e test that imports a real 32768x8 PNG, generated in the test, and checks the notice text, the kept image, that history and the "no image" wording are unchanged, and that a 32767x8 PNG still imports. Fixes vycdev#125
0d7fe5e to
69ebcfd
Compare
|
The e2e jobs here failed in the "Install Playwright system dependencies" step, before any test ran: the runner couldn't resolve |
Importing an image beyond the browser's canvas limits used to replace the working image with a blank preview and leave the app sluggish. This change refuses the file before it enters image history, shows a localized notice with its dimensions and resize advice, and keeps the current image, undo history, and swatches.
The import uses a conservative budget of 268,435,456 pixels and 65,535 pixels per side. iPhone and iPad, including desktop browsing mode, use a lower 16,777,216-pixel budget for compatibility with older Safari versions. The notice recommends 4096×4096 or 16384×16384 as appropriate. Small canvas probes check each axis without allocating a full-size test canvas, so older browsers with lower dimension limits are handled while supported thin panoramas (such as 40000×8) can still load. The probe tolerates small alpha changes from browser fingerprinting protection while still refusing blank or nearly transparent results.
The check stays in the main image import hook. Stack Matrix photos still load through their existing path, which draws them at no more than 1200 pixels. Loading Images and Troubleshooting explain the behavior in all 12 languages, and the unreleased changelog entry includes the final behavior and coverage.
Fixes #125.
Validation:
npm run test:e2e:allran all eight suites. Smoke (90), docs (6), landing (19), 404 (10), i18n (17), and i18n production-build (4) tests all passed. Privacy (9 passed, 4 failed) and terms (6 passed, 4 failed) reproduce only the existing footer-count failures from Privacy and terms e2e footer tests still expect 7 links after the Awards link #143: expected seven links, received eight.