Repository navigation
Image Processing
English · 한국어
Client v1.0.0 converts JPEG, PNG, WebP, HEIC, and HEIF to WebP on-device. It does not send originals to a conversion server. Inputs larger than 2 MiB are allowed, but the final WebP must be at most 2,000,000 bytes.
- At most four photos per entry. A selection exceeding remaining slots is rejected without changing existing photos. Convert sequentially; report individual failures and keep successful/existing photos.
- Add, remove, and replace photos individually. Replacement preserves order. While existing photos are loading or failed, saving is blocked. Canceling an edit does not alter stored photos.
- Two photos use side-by-side layout; three use one large left photo and two right photos; four use a 2×2 grid. The viewer supports full images, previous/next, arrow keys, and Escape.
- Draft restoration restores text; unsaved photo attachments trigger a navigation warning.
- Input limits: 50 MiB, 50,000,000 pixels, and at most 32,768 pixels per side.
- Preserve aspect ratio and reduce the long side to at most 1,000px; do not upscale. Low-resource mode starts at 800px.
- Try qualities
0.82 → 0.70 → 0.55 → 0.40at each size, then reduce the long side through1,000 → 800 → 600 → 400pxif necessary. Reject images still over the limit, empty output, or PNG output mislabeled as WebP. - Re-encode pixels through Canvas without copying original EXIF/GPS or XMP. Clean up bitmaps and canvases on success and failure. Block duplicate selection/saving during conversion; discard stale results after canceling, changing edit targets, or locking.
WebP display support and Canvas encoding support are different. Inspect the actual toBlob MIME type. If Canvas returns PNG, lazily load @jsquash/webp 1.5.0 and encode resized pixels using WebAssembly in a dedicated Worker. Apply the same size/quality limits, validate RIFF/WebP signatures, and terminate the Worker afterward.
CSP needs 'wasm-unsafe-eval' for WebAssembly, without JavaScript 'unsafe-eval' or 'unsafe-inline'. Apply generated out/_headers on the host. Encoder code/WASM may require a connection on first use or after an offline restart. Report loading/execution failures so users can retry.
Detect HEIF from MIME, case-insensitive .heic/.heif, or ftyp brands. Try native browser decoding first, then lazily load heic-to/csp 1.5.2 in an on-device Worker. Ordinary JPEG/PNG/WebP inputs do not load it. Use the first image returned by the library; this does not promise full multi-image, video, Live Photo, or HEIF codec support. Invalid/unsupported files produce an error.
The host must honor worker-src 'self' blob: from public/_headers. First fallback use needs the decoder assets; offline restart behavior and physical-device support require separate verification.
Before HEIF decoding, inspect ispe within a meta box of at most 2 MiB. Reject missing, malformed, or truncated metadata and inspect at most 256 top-level boxes. Also check decoded dimensions for all formats. These limits bound inputs, resolution, and retries, not peak browser/decoder memory. JPEG/PNG/WebP native decoders can allocate full pixels before dimension checks. High-resolution/HDR/rotated/multi-image inputs and prolonged use require physical iOS/Android checks.
In web/, use npm run build, npm run test:unit, and npm run test:browser. Install browsers with npx playwright install --with-deps chromium webkit. Unit checks cover limits, quality/size order, portrait/low-resource cases, cleanup, and HEIF detection/metadata. Browser checks use real CSP and actual conversions: PNG over 2 MiB, forced PNG-to-WASM fallback, HEIC fixtures, padded HEIF, corrupted input, duplicate actions, and cancellation. Check signatures, MIME, bytes, dimensions, metadata removal, upload absence, and CSP violations.
Windows Playwright WebKit does not substitute for iPhone testing. Decoder: heic-to, LGPL-3.0 with embedded libheif. Encoder: jSquash, Apache-2.0 with embedded libwebp. Fixture provenance is maintained with the tests.
- Client development · 클라이언트 개발
- Self-hosting · 자체 호스팅
- PWA, offline use, and updates · PWA·오프라인·업데이트
- Client performance · 클라이언트 성능
- Architecture · 아키텍처
- Cryptographic format · 암호화 형식
- Image processing · 사진 처리
- Security model · 보안 경계
- Product principles · 제품 원칙
- Dependency licenses · 의존성 라이선스
- Account and sync · 계정과 동기화
- Backup and recovery · 백업과 복구
- Entry quotes · 기록 인용
- Profile document · 프로필 문서