Repository navigation
Conversation
dxrpl
force-pushed
the
fix/6818-image-routes-bad-input
branch
from
October 28, 2026 17:27
d978c60 to
6b284d2
Compare
This branch has not been deployed
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.
Summary
sharpen,remove-bg,denoise,upscale-localandenhance-facedecoded the client'simagewith a barebase64.b64decode+Image.open, so a missing, malformed or non-imageimageended in an unhandled exception and a 500. They now use the existing_b64_to_pil_image()helper, whichharmonize,inpaintandmaskalready use, so they answer400 Missing image/400 Invalid image. The existing400 No image providedchecks indenoise,upscale-localandenhance-facestay as they were. Valid images are processed as before.Target branch
labin the private maintainer-preview repository, ordevin the public repository.mainremains release-curated.Linked Issue
Fixes #6818
Type of Change
Checklist
labin maintainer-preview;devin the public repository)docker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
I ran the branch natively (
uvicorn app:app, scratch data dir), logged in as admin, and POSTed{},{"image":"!!notb64"}and{"image":"aGVsbG8="}to each of the five routes. Ondevthese gave 500 (12 of the 15 requests; the other 3 were the existingNo image provided400). On this branch all 15 give 400. I did not run the editor UI or a real image through Real-ESRGAN/GFPGAN, because those packages are not installed here. The newtests/test_gallery_image_bad_input.pyfails ondev(12 failures) and passes with the change, together with the existing gallery tests.To check by hand:
curl -b cj -X POST -H 'content-type: application/json' -d '{"image":"!!notb64"}' localhost:7000/api/image/sharpen(repeat forremove-bg,denoise,upscale-local,enhance-face).400 {"detail":"Invalid image"}, not a 500.Visual / UI changes — REQUIRED if you touched anything that renders
No visual change: the edit only fixes variable scoping so the existing timeout message is reachable. No markup, CSS or styling was touched.
Screenshots / clips
The reply bubble after the 120 s timeout, with the fix applied: