Skip to content

feat: add TIFF/TIF image preview support using UTIF - #194

Merged
overtrue merged 1 commit into
rustfs:mainfrom
liaozip:feat/tiff-preview-support
Aug 4, 2026
Merged

feat: add TIFF/TIF image preview support using UTIF#194
overtrue merged 1 commit into
rustfs:mainfrom
liaozip:feat/tiff-preview-support

Conversation

@liaozip

@liaozip liaozip commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add client-side TIFF/TIF image preview support in the RustFS Console browser.

Browsers do not natively support rendering TIFF images (image/tiff). This PR adds a TiffViewer component that decodes TIFF files client-side using the UTIF library and renders them to an HTML Canvas element.

Changes

New Files

  • components/object/tiff-viewer.tsx — Client-side TIFF decoder & canvas renderer with two-phase rendering (decode then canvas render) to avoid race condition where canvas ref is null during loading state
  • types/utif.d.ts — TypeScript definitions for UTIF

Modified Files

  • components/object/preview-modal.tsx — Added tiff preview mode that renders TiffViewer for .tif/.tiff files
  • package.json — Added utif@^3.1.0 dependency
  • pnpm-lock.yaml — Updated

How It Works

  1. User clicks Preview on a .tif/.tiff file
  2. TiffViewer fetches raw bytes via signed URL
  3. UTIF decodes the TIFF buffer and converts to RGBA pixel data
  4. RGBA data rendered to canvas via putImageData()

Supports multi-page TIFF and compressed formats (LZW, Deflate, PackBits, JPEG).

- Add TiffViewer component with two-phase rendering (decode then canvas render)
  to fix race condition where canvas ref is null during loading state
- Add TypeScript type definitions for UTIF library
- Integrate TiffViewer into preview-modal for .tif/.tiff file previews
- Add utif@^3.1.0 dependency
- Supports multi-page TIFF, compressed TIFF (LZW, Deflate, PackBits, JPEG)
@overtrue
overtrue merged commit 28b2cd9 into rustfs:main Aug 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants