pub enum ValidationError {
IoError(Error),
JpegDetected,
WebpDetected,
NotPng,
UnsupportedColorSpace {
found: String,
},
ImageTooSmall {
width: u32,
height: u32,
min: u32,
},
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
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
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
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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