Skip to Content

TiffViewer

TiffViewer renders a TIFF image from an OSDK Media object, and BaseTiffViewer renders one from raw bytes.

Import

import { BaseTiffViewer, TiffViewer } from "@osdk/react-components/tiff-viewer";
  • TiffViewer — Primary component for OSDK usage. Accepts an OSDK Media object, handles fetching the TIFF contents, and renders via BaseTiffViewer.
  • BaseTiffViewer — Lower-level component that accepts raw Uint8Array bytes directly.

Usage

With OSDK Media

import { TiffViewer } from "@osdk/react-components/tiff-viewer";

<TiffViewer media={scan.tiffImage} />;

With raw bytes

import { BaseTiffViewer } from "@osdk/react-components/tiff-viewer";

<BaseTiffViewer src={tiffBytes} />;

Props

BaseTiffViewerProps

PropTypeDefaultDescription
srcUint8ArrayundefinedTIFF bytes to render
contentUint8ArrayundefinedDeprecated — rename to src
classNamestringundefinedCSS class applied to the root element
onError() => voidundefinedCallback fired when rendering fails

TiffViewerProps

PropTypeDefaultDescription
mediaMedia(required)The OSDK Media object to fetch TIFF from
classNamestringundefinedCSS class applied to the root element
onError() => voidundefinedCallback fired when rendering fails

Features

  • Decodes and renders TIFF images onto a <canvas> element using the utif library
  • Handles multi-page TIFF files (renders the first page)
  • Size validation — rejects images exceeding 25 MB
  • Error handling with user-friendly messages for corrupted or oversized files

On this page