Integrate upstream changes
This commit is contained in:
1 parent
ec72f33dbc
commit
9c098c4bee
5 files changed
+9
-19
No files matched your search
+1
-3
@@ -75,8 +75,7 @@ tags!{
|
||||
Predictor 317;
|
||||
}
|
||||
|
||||
enum_from_primitive! {
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, FromPrimitive)]
|
||||
pub enum Type {
|
||||
BYTE = 1,
|
||||
ASCII = 2,
|
||||
@@ -84,7 +83,6 @@ pub enum Type {
|
||||
LONG = 4,
|
||||
RATIONAL = 5,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[allow(unused_qualifications)]
|
||||
|
||||
+5
-13
@@ -35,8 +35,7 @@ enum DecodingBuffer<'a> {
|
||||
U16(&'a mut [u16])
|
||||
}
|
||||
|
||||
enum_from_primitive! {
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, FromPrimitive)]
|
||||
enum PhotometricInterpretation {
|
||||
WhiteIsZero = 0,
|
||||
BlackIsZero = 1,
|
||||
@@ -47,10 +46,8 @@ enum PhotometricInterpretation {
|
||||
YCbCr = 6,
|
||||
CIELab = 8,
|
||||
}
|
||||
}
|
||||
|
||||
enum_from_primitive! {
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, FromPrimitive)]
|
||||
enum CompressionMethod {
|
||||
None = 1,
|
||||
Huffman = 2,
|
||||
@@ -60,23 +57,18 @@ enum CompressionMethod {
|
||||
JPEG = 6,
|
||||
PackBits = 0x8005
|
||||
}
|
||||
}
|
||||
|
||||
enum_from_primitive! {
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, FromPrimitive)]
|
||||
enum PlanarConfiguration {
|
||||
Chunky = 1,
|
||||
Planar = 2
|
||||
}
|
||||
}
|
||||
|
||||
enum_from_primitive! {
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, FromPrimitive)]
|
||||
enum Predictor {
|
||||
None = 1,
|
||||
Horizontal = 2
|
||||
}
|
||||
}
|
||||
|
||||
/// The representation of a TIFF decoder
|
||||
///
|
||||
@@ -179,7 +171,7 @@ impl<R: Read + Seek> Decoder<R> {
|
||||
if self.bits_per_sample.len() == 1 => Ok(ColorType::Gray(self.bits_per_sample[0])),
|
||||
|
||||
_ => Err(TiffError::UnsupportedError(format!(
|
||||
"{:?} with {:?} bits per sample is unsupported", self.bits_per_sample, self.photometric_interpretation
|
||||
"{:?} with {:?} bits per sample is unsupported", self.photometric_interpretation, self.bits_per_sample
|
||||
))) // TODO: this is bad we should not fail at this point}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,8 +8,8 @@
|
||||
|
||||
extern crate byteorder;
|
||||
extern crate lzw;
|
||||
#[macro_use] extern crate num_derive;
|
||||
extern crate num_traits;
|
||||
#[macro_use] extern crate enum_primitive;
|
||||
|
||||
pub mod decoder;
|
||||
mod error;
|
||||
|
||||
Reference in new issue
Block a user