eadec8f0b960027de82203137f0d86ecd75be714
Convert most unchecked size/index `as` casts to checked casts with `TryFrom`, included another top-level error variant. This has several motivations: - Making the library as robust as possible, including to platform differences. - Unchecked casts are susceptible to breakage during refactorings. - Preparing for BigTIFF support, which will require the introduction of generics and associated types for some parts of the de/encoders. Unchecked primitive casts cannot be bound, while TryFrom can, and overflowing conversions become more likely. - Remaining u16 casts may be prone in failure in existing practice and not just in theory during future changes.
image-tiff
TIFF decoding and encoding library in pure Rust
Supported
Features
- Baseline spec (other than formats and tags listed below as not supported)
- Multipage
- Incremental decoding
Formats
This table lists photometric interpretations and sample formats which are supported for encoding and decoding. The entries are ColorType variants for which sample bit depths are supported. Only samples where all bit depths are equal are currently supported. For example, RGB(8) means that the bit depth [8, 8, 8] is supported and will be interpreted as an 8 bit per channel RGB color type.
PhotometricInterpretation |
UINT Format | IEEEFP Format |
|---|---|---|
WhiteIsZero |
Gray(8 | 16 |
BlackIsZero |
Gray(8 | 16 |
RGB |
RGB(8 | 16 |
RGBPalette |
||
Mask |
||
CMYK |
CMYK(8 | 16 |
YCbCr |
||
CIELab |
Compressions
| Decoding | Encoding | |
|---|---|---|
| None | ✓ | ✓ |
| LZW | ✓ | |
| Deflate | ✓ | |
| PackBits | ✓ |
Not yet supported
Formats and interpretations not listed above or with empty entries are unsupported.
- Baseline tags
ExtraSamples
- Extension tags
- BigTIFF
Description
Fork of https://github.com/image-rs/image-tiff, modifying the tiff crate to be able to read RGBPalette tiffs.
14 MiB
0 Stars
1 Watchers
0 Forks
Languages
Rust
88.1%
C
11.5%
Shell
0.4%