Commit Graph
1299 Commits
Author SHA1 Message Date
SnapOtter 2f41629a14 fix: resolve pre-existing test failures for content-aware-crop removal and watermark validation
- Replace content-aware-crop with ai-canvas-expand in TOOLS[], AI_TOOL_IDS,
  and FEATURE_BUNDLES (matching the already-updated tool-registry.tsx and
  feature-manifest.json from commit c6a5d3f)
- Fix trailing syntax error in features.ts (extra closing brace)
- Add ai-canvas-expand-settings mock to tool-registry test files
- Update watermark-image tests to expect 400 (validation rejection) instead
  of 422 (processing failure) for corrupted image buffers, matching the
  actual route behavior where validateImageBuffer catches them first
2026-05-13 21:15:44 +08:00
SnapOtter f467191e9b fix(oidc): preserve authProvider on auto-link
Linked users keep authProvider="local" so they can still log in
with their local password. Only externalId is set during linking.
2026-05-13 20:11:11 +08:00
SnapOtter 85e3ed0c65 test(oidc): expand integration test coverage for cookies, API keys, logout, session expiry 2026-05-13 19:30:37 +08:00
SnapOtter eacdb867ac docs: add OIDC setup guide with provider examples 2026-05-13 19:17:14 +08:00
SnapOtter fda4e25296 test(oidc): add integration tests for OIDC auth flow
Covers session response fields, password guards, users list,
config endpoint, login redirect, callback edge cases, and
backward compatibility. Also adds migration to make password_hash
nullable (required for OIDC-only users) and vitest aliases for
@fastify/cookie and openid-client.
2026-05-13 19:14:34 +08:00
SnapOtter 71496db6c5 feat(oidc): add OIDC environment variables to Docker configuration 2026-05-13 19:07:33 +08:00
SnapOtter 42265af47b feat(oidc): update settings dialog with OIDC user handling and logout flow 2026-05-13 19:06:22 +08:00
SnapOtter 44f42c6866 feat(oidc): add OIDC login button and auth hook updates 2026-05-13 19:04:06 +08:00
SnapOtter aaebd14c60 feat(oidc): register cookie and OIDC plugins, extend config endpoint 2026-05-13 19:01:30 +08:00
SnapOtter 71b6489a0d feat(oidc): implement OIDC Fastify plugin with login redirect and callback 2026-05-13 18:58:35 +08:00
SnapOtter ad4ca27f03 feat(oidc): update auth middleware for cookie extraction and OIDC user handling 2026-05-13 18:52:39 +08:00
SnapOtter 5a95af70f4 feat(oidc): add OIDC environment variables with cross-field validation 2026-05-13 18:49:29 +08:00
SnapOtter 877475d1c9 feat(oidc): add OIDC columns to users and sessions tables 2026-05-13 18:47:54 +08:00
SnapOtter 446bad3b10 feat(oidc): install openid-client and @fastify/cookie 2026-05-13 18:45:59 +08:00
SnapOtter beb94b698c fix(web): redesign image editor icon for better clarity
Replace abstract curve-and-dots icon with a recognizable photo frame
and pencil design that reads clearly as an image editor at all sizes.
2026-05-13 18:18:20 +08:00
SnapOtter c6a5d3f33e refactor: remove content-aware-crop tool
Remove the content-aware-crop tool entirely -- API route, frontend
settings component, e2e and integration tests, and all registry
entries.
2026-05-13 17:55:01 +08:00
SnapOtter 05720f350a Revert "feat: replace AI matting with chroma-based checkerboard detection"
This reverts commit f1a4c94375.
2026-05-13 17:20:33 +08:00
SnapOtter a03d4f34ff fix(ai): tune scratch detection thresholds and remove erosive open step
- Two-gate threshold: Otsu >= 60 uses Otsu; 40-59 uses fixed 100
  (catches strong scratches on borderline images)
- Remove morphological OPEN after component filtering: it was eroding
  thin scratch lines that were correctly detected
- Lower Otsu gate from 60 to 40 to avoid false-negating borderline images
2026-05-13 17:17:32 +08:00
SnapOtter f1a4c94375 feat: replace AI matting with chroma-based checkerboard detection
The transparency-fixer now directly detects the baked-in checkerboard
pattern using per-pixel chroma analysis instead of BiRefNet AI matting.
Achromatic pixels in the gray range are classified as background
(transparent), chromatic pixels as foreground (opaque), with smooth
transitions at anti-aliased edges.

- No longer requires Python sidecar or background-removal bundle
- Watermark removal uses Sharp median(5) filter pre-processing
- Moved tool from "ai" to "utilities" category
- Removed from PYTHON_SIDECAR_TOOLS and background-removal enablesTools
- Near-instant processing (pure Sharp, no model inference)
2026-05-13 17:16:02 +08:00
SnapOtter 443e9a4ffa fix: replace broken LaMa watermark detection with median filter approach
The luminance anomaly detection + LaMa inpainting approach failed because
watermark signal on the matted foreground was too weak (10-15 units vs
threshold of 25). Median filter with kernel=5 effectively removes
semi-transparent watermark text while preserving the stamp structure.

Pipeline is now: median filter (if toggle on) -> BiRefNet matting -> defringe.
No longer requires object-eraser-colorize bundle for watermark removal.
2026-05-13 17:08:15 +08:00
SnapOtter 132aa2cd0f test(e2e): update restore-photo tests for mode removal and colorize strength 2026-05-13 17:07:21 +08:00
SnapOtter 6f30dbc09e feat(web): remove mode selector, add colorize strength slider 2026-05-13 17:06:45 +08:00
SnapOtter 1b81fc61f1 fix(ai): face guard for small faces, remove mode system, add colorizeStrength 2026-05-13 17:03:57 +08:00
SnapOtter e429f6fd6a fix(ai): tiled LaMa inpainting at native resolution 2026-05-13 17:02:37 +08:00
SnapOtter a6c5016c35 fix(ai): rewrite scratch detection with 8-angle Otsu and component filtering 2026-05-13 17:01:50 +08:00
SnapOtter 79cb570a3a refactor(api): remove mode, add colorizeStrength, lower denoise default to 25 2026-05-13 16:59:13 +08:00
SnapOtter 693b441aa0 refactor(ai): remove mode, add colorizeStrength to restore options 2026-05-13 16:55:38 +08:00
SnapOtter dd6ea16dd4 docs: add restore-photo quality overhaul implementation plan
8 tasks covering: TS bridge update, API schema changes, Python scratch
detection rewrite, tiled LaMa inpainting, face enhancement guard,
frontend settings, E2E tests, and diagnostic verification.
2026-05-13 16:52:21 +08:00
SnapOtter 32ff0f6217 docs: add restore-photo quality overhaul design spec
Evidence-based spec informed by diagnostic testing on 4 sample images.
Addresses catastrophic scratch over-detection (up to 68.7% false
coverage on small images), LaMa 512x512 resolution loss, CodeFormer
over-smoothing on small faces, and excessive NLMeans defaults.
2026-05-13 16:41:30 +08:00
SnapOtter 54f3867086 feat: add Remove Watermark toggle UI with feature gating and e2e tests 2026-05-13 16:20:40 +08:00
SnapOtter 182841b853 feat: add watermark detection and LaMa inpainting to transparency-fixer pipeline 2026-05-13 16:18:28 +08:00
SnapOtter 1581fa933f feat: add i18n strings for transparency-fixer watermark removal 2026-05-13 16:15:13 +08:00
SnapOtter e1ca06cd95 fix: update unit tests for DecodedPreview return type and outpaint tier arg 2026-05-13 15:53:09 +08:00
SnapOtter c3dc98834d feat: add quality tier selector to AI canvas expand UI 2026-05-13 15:47:58 +08:00
SnapOtter aae1a26efc test: add e2e tests for AI canvas expand quality tier UI 2026-05-13 15:47:39 +08:00
SnapOtter ae7c620c92 test: add tier parameter validation tests for AI canvas expand 2026-05-13 15:47:28 +08:00
SnapOtter 2743d9df22 feat(api): add quality tier to ai-canvas-expand schema and routes
Add tier enum (fast/balanced/high) with balanced default to the Zod
settings schema. Pass tier through to outpaint options in both the HTTP
route and the pipeline/batch registry. Fix log message to say
"Starting AI canvas expand" and include tier in structured log fields.
2026-05-13 15:46:08 +08:00
SnapOtter cc2c182e67 feat(ai): pass quality tier through Node outpaint bridge
Add optional tier field to OutpaintOptions interface and forward it as
the 7th argument to the Python outpaint script, defaulting to balanced.
2026-05-13 15:46:02 +08:00
SnapOtter 55e544317c feat(ai): parameterize outpaint pipeline with quality tier support
Add TIER_PARAMS dict with fast/balanced/high presets controlling band
size, mask dilation, seam strip width, and Telea pre-inpainting. Parse
tier from sys.argv[7] with balanced fallback. Conditional Telea and
seam refinement steps skip cleanly for fast tier. Progressive outpaint
now accepts band_size and progress bounds for tier-appropriate scaling.
2026-05-13 15:45:19 +08:00
SnapOtter 3760885342 fix: restore-photo colorize hang and AVIF decode failures
- Fix dispatcher pipe deadlock: drain stdout pipe in a background thread
  to prevent blocking when ONNX runtime output exceeds 64KB pipe buffer
- Add 5-minute SSE stall timeout so the UI shows an error instead of
  hanging forever when async AI processing stalls
- Guard CPU colorization: skip for images >2MP on CPU and when DDColor
  model is not installed, with clear user-facing messages
- Add AVIF decode fallback via ImageMagick for bitstream variants that
  Sharp's bundled libheif cannot decode (affects all tools)
2026-05-13 15:42:24 +08:00
SnapOtter 917c1ff773 fix: EXR/HDR decode failures and batch network timeout
EXR: add ffmpeg fallback when ImageMagick lacks the OpenEXR delegate
(common on macOS Homebrew installs). HDR: force 8-bit depth output to
prevent CLAHE crash (hist_local requires VIPS_FORMAT_UCHAR). Batch:
disable socket timeout and increase server requestTimeout to 30 min
so large AI batches don't get killed by Node.js defaults.
2026-05-13 14:19:51 +08:00
SnapOtter 648c8c12f5 fix: convert input buffer to PNG before passing to face landmarks Python sidecar
AVIF (and other Sharp-native formats) were written as raw bytes to a
.png temp file, causing PIL to fail with "cannot identify image file".
Every other AI module wrapper already converts via sharp().png().toBuffer()
before writing; face-landmarks was the only one that skipped this step.
2026-05-13 14:18:49 +08:00
SnapOtter 0b3f46407a fix: convert HDR/EXR to 8-bit before CLAHE in image enhancement
HDR and EXR files decoded by ImageMagick can produce 16-bit PNG buffers.
Sharp's CLAHE operation (hist_local) requires VIPS_FORMAT_UCHAR (8-bit).
Check the buffer depth and convert to 8-bit sRGB before processing.
2026-05-13 14:16:18 +08:00
SnapOtter ec4c97cc59 test: e2e tests for multi-file eraser stroke persistence and Erase All 2026-05-13 13:45:39 +08:00
SnapOtter 10a6c72f9e test: add sequential multi-file erase-object integration test 2026-05-13 13:45:08 +08:00
SnapOtter b413ace031 feat: multi-file eraser with sequential processing and Erase All button 2026-05-13 13:43:13 +08:00
SnapOtter a5a46a5ece feat: wire maskedFileCount through eraser props 2026-05-13 13:38:15 +08:00
SnapOtter bfffe8a6bd fix: gate eraser canvas on previewLoading for exotic formats 2026-05-13 13:37:57 +08:00
SnapOtter 09d494d87d feat: store eraser strokes per-image for multi-file support 2026-05-13 13:32:44 +08:00
SnapOtter 3497cd0c9a fix: show checkerboard pattern for transparent background in remove-bg tool 2026-05-13 12:10:01 +08:00