View a multipage TIFF in Javascript
I currently have multi-paged TIFF
images and 开发者_如何转开发I need to browse them page by page via Javascript.
I have no clue about that. Can you help me? I found some other questions but none seems related to Javascript.
Thank you.
I ported the LibTIFF library to Javascript with Emscripten (https://github.com/seikichi/tiff.js). This page (http://seikichi.github.io/tiff.js/multipage.html) is the demo of multipage tiff file.
There are plugin that provide those function. Alternatiff is a good example.
Update
The original project no longer seems to be maintained (thanks Victoria!), but both tiff.js by GPHelmley and seikichi's libTiff port mentioned in their answer have active forks; see
https://github.com/seikichi/tiff.js/network
and
https://github.com/GPHemsley/tiff-js/network
Original
A new, native JavaScript tiff approach has appeared since the last round of answers: tiff.js, with comments on multi-page tiff support here (apparently added in to pdf.js though I haven't checked it out).
I found that for my case it was easy to hack the tiff.js code to allow loading multipage tiffs really easily, and plan to contribute the hack to the tiff.js repo.
I very much doubt JavaScript can help you here: Most browsers can't deal with TIFF images in the first place, let alone multi-page ones.
You will need the help of server-side scripting - like PHP - in combination with a tool like ImageMagick.
I've never tried this myself, but IM's multipage syntax seems to be pretty straightforward:
# extract page 15 from tiff file
convert 'image.tif[15]' image-15.jpg
note that if your TIFF is in CMYK format, you will need to perform an additional colour space conversion to RGB - Internet Explorer can't deal with CMYK images in any format.
If you're ok with a certain plugin technology (namely Silverlight or Moonlight), you can use the free LibTiff .NET library to process and display most kinds of TIFF files client-side.
精彩评论