#[derive(Debug, thiserror::Error)]
pub enum ImageError {
#[error("{0}")]
InvalidArgument(String),
#[error("{0}")]
NotSupported(String),
#[error("{0}")]
DirectoryNotFound(String),
#[error("{0}")]
FileNotFound(String),
#[error("{0}")]
FileNotReadable(String),
#[error("{0}")]
FileNotWritable(String),
#[error("{0}")]
Decoder(String),
#[error("{0}")]
Encoder(String),
#[error("{0}")]
ColorDecoder(String),
}
pub type Result<T, E = ImageError> = std::result::Result<T, E>;
pub(crate) fn invalid(message: impl Into<String>) -> ImageError {
ImageError::InvalidArgument(message.into())
}