Enum png::common::ParameterErrorKind
source · pub(crate) enum ParameterErrorKind {
ImageBufferSize {
expected: usize,
actual: usize,
},
PolledAfterEndOfImage,
PolledAfterFatalError,
}
Variants§
ImageBufferSize
A provided buffer must be have the exact size to hold the image data. Where the buffer can be allocated by the caller, they must ensure that it has a minimum size as hinted previously. Even though the size is calculated from image data, this does counts as a parameter error because they must react to a value produced by this library, which can have been subjected to limits.
PolledAfterEndOfImage
A bit like return None
from an iterator.
We use it to differentiate between failing to seek to the next image in a sequence and the
absence of a next image. This is an error of the caller because they should have checked
the number of images by inspecting the header data returned when opening the image. This
library will perform the checks necessary to ensure that data was accurate or error with a
format error otherwise.
PolledAfterFatalError
Attempt to continue decoding after a fatal, non-resumable error was reported (e.g. after
[DecodingError::Format
]). The only case when it is possible to resume after an error
is an UnexpectedEof
scenario - see [DecodingError::IoError
].