feat: accept sub-byte bit depths for all color types
Previously, sub-byte bit depths (1-7 bits per sample) were only accepted for Gray and Multiband color types. This extends the validation to accept all color types (RGB, RGBA, CMYK, CMYKA, YCbCr) at sub-byte depths. The data format is unchanged: sub-byte samples remain packed MSB-first in the output buffer, exactly as for grayscale. Predictors are still rejected for sub-byte data. Tested via libtiffpic flower-rgb-contig-02/04 and flower-rgb-planar-02/04.
This commit is contained in:
1 parent
3d3c16e26f
commit
4ff374990e
1 file changed
+6
-1
@@ -1030,7 +1030,12 @@ impl Image {
|
||||
bit_depth: n,
|
||||
num_samples: _,
|
||||
} if n == 8 || n == 16 || n == 32 || n == 64 => {}
|
||||
ColorType::Gray(n)
|
||||
ColorType::RGB(n)
|
||||
| ColorType::RGBA(n)
|
||||
| ColorType::CMYK(n)
|
||||
| ColorType::CMYKA(n)
|
||||
| ColorType::YCbCr(n)
|
||||
| ColorType::Gray(n)
|
||||
| ColorType::Palette(n)
|
||||
| ColorType::Multiband {
|
||||
bit_depth: n,
|
||||
|
||||
Reference in new issue
Block a user