pub enum ValidationError {
IoError(Error),
JpegDetected,
WebpDetected,
NotPng,
UnsupportedColorSpace {
found: String,
},
ImageTooSmall {
width: u32,
height: u32,
min: u32,
},
ImageTooLarge {
width: u32,
height: u32,
pixels: u64,
max: u64,
},
DecodingError(String),
JpegArtifactsDetected {
ratio: f32,
},
}Expand description
Every way the validation pipeline can reject a candidate container image.
Variants§
IoError(Error)
The file could not be read from disk.
JpegDetected
The file is a JPEG. Lossy containers destroy embedded payloads.
WebpDetected
The file is a WebP. Lossy containers destroy embedded payloads.
NotPng
The file is not a PNG, and not a format we can name specifically.
UnsupportedColorSpace
The PNG decodes to a pixel layout the embedder cannot use.
ImageTooSmall
The image is smaller than the minimum accepted size.
Fields
ImageTooLarge
The image has more pixels than the analysis will attempt.
Reported from the header, before anything is decoded; see
[MAX_PIXELS] for why a limit exists at all.
Fields
DecodingError(String)
The PNG stream is malformed or truncated.
JpegArtifactsDetected
The image is a lossless re-encoding of previously JPEG-compressed data.
Fields
ratio: f32Blocking ratio measured over the sampled 8x8 blocks. Around 1.0
for a clean image; the higher it is, the stronger the JPEG grid. See
crate::image_io::jpeg_detect::detect_jpeg_artifacts.
Trait Implementations§
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for ValidationError
impl From<Error> for ValidationError
Source§impl From<ValidationError> for PipelineError
impl From<ValidationError> for PipelineError
Source§fn from(err: ValidationError) -> Self
fn from(err: ValidationError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ValidationError
impl !UnwindSafe for ValidationError
impl Freeze for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more