Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIFF decoding support #1398

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

andylizi
Copy link

@andylizi andylizi commented Feb 3, 2024

libtiff was compiled with support for all compression schemes defined by the TIFF 6.0 spec, in addition to schemes that Wikipedia considered "Common".

Closes #1092.

  Libtiff build version:              4.6.0
  Libtiff library version:            6:2:0
  Libtiff release date:               20230908

  Installation directory:             /usr/local
  Documentation directory:            ${prefix}/share/doc/tiff-4.6.0
  C compiler:                         clang-17 --target=wasm32-wasi --sysroot=/wasi-sysroot
  C++ compiler:                       clang++-17 --target=wasm32-wasi --sysroot=/wasi-sysroot
  Build tools:                        no
  Build tools-unsupported:            no
  Build tests:                        no
  Build contrib:                      no
  Build docs:                         no
  Build deprecated features:          no
  Enable runtime linker paths:        no
  Enable linker symbol versioning:    no
  Support Microsoft Document Imaging: no
  Use Win32 IO:                       no

 Support for internal codecs:
  CCITT Group 3 & 4 algorithms:       yes
  Macintosh PackBits algorithm:       yes
  LZW algorithm:                      yes
  ThunderScan 4-bit RLE algorithm:    no
  NeXT 2-bit RLE algorithm:           no
  LogLuv high dynamic range encoding: yes

 Support for external codecs:
  ZLIB support:                       yes
  libdeflate support:                 no
  Pixar log-format algorithm:         yes
  JPEG support:                       yes
  Old JPEG support:                   no
  JPEG 8/12 bit dual mode:            yes (libjpeg turbo >= 2.2 dual mode)
  ISO JBIG support:                   no
  LERC support:                       no
  LZMA2 support:                      no
  ZSTD support:                       no
  WEBP support:                       no

  C++ support:                        no

It was compiled using WASI toolchain instead of Emscripten because I vaguely recall last time I tried this with Emscripten I encountered a lot of issues. But it was a long time ago and I can't remember what those issues were...

@surma
Copy link
Collaborator

surma commented Feb 5, 2024

Thanks so much for whipping up a PR. I really appreciate the effort. I’d love to merge and ship this, however I haven’t really reviewed any code because to the last of my knowledge, the problem is that TIFF the file format is patented. This is not about the code that contains the library, but the intellectual property. I do not think we can ship this.

I’d love to be proven wrong, tho...

@andylizi
Copy link
Author

andylizi commented Feb 5, 2024

I've been looking around and wasn't able to find any information referring to patents or licensing requirements on the TIFF format. According to this Library of Congress page, the "Licensing and patents" sustainability factor for TIFF is described as:

Not exploited for the TIFF wrapper format. The only widely used compression scheme for the embedded image data that has been subject to patent claims in recent years is LZW (Lempel-Ziv-Welch) compression, i.e., in TIFF_LZW. The LZW patent is generally reported as having expired in 2003 (U.S.) and 2004 (Europe and Japan).

Besides libtiff, other libraries don't seem to have concerns with it either, such as Google's TIFF library written in Go, and another Rust library used in the popular image processing crate image-rs.

@andylizi
Copy link
Author

@surma Hi, could you take a look when you get a chance? Thanks!

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.

Add TIFF support
2 participants