Provide write_entry_bytes
This complements the entry API of the encoder with the byte slice based method. Note we don't provide it for writing raw data, here a `std::io::Write` would be more appropriate and we should not attempt to make it `write_all`, nor compress. You'd get all the benefits of the other API through `[u8]: TiffValue` since that interface is otherwise type agnostic and `u8` specifically is endian agnostic.
This commit is contained in:
1 parent
9d409433e8
commit
9a23090b6e
2 files changed
+31
No files matched your search
@@ -5,6 +5,7 @@ use std::string;
|
||||
use quick_error::quick_error;
|
||||
|
||||
use crate::decoder::ChunkType;
|
||||
use crate::tags::Type;
|
||||
use crate::tags::{
|
||||
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, SampleFormat, Tag,
|
||||
};
|
||||
@@ -211,6 +212,9 @@ quick_error! {
|
||||
ByteOrderMismatch {
|
||||
display("attempted to use data with a byte order that does not match the required one")
|
||||
}
|
||||
MismatchedEntryLength {ty: Type, found: usize } {
|
||||
display("the length of data is not a multiple of the size of the type {ty:?}, found {found}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user