Enum png::common::ParameterErrorKind
source · pub(crate) enum ParameterErrorKind {
ImageBufferSize {
expected: usize,
actual: usize,
},
PolledAfterEndOfImage,
}
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.