Add error types and core image types: ImageFormat, ImageSource, Dimensions, QualityPreset
This commit is contained in:
@@ -1 +1,27 @@
|
||||
// Error types
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum PixstripError {
|
||||
#[error("Failed to load image '{path}': {reason}")]
|
||||
ImageLoad { path: PathBuf, reason: String },
|
||||
|
||||
#[error("Unsupported format: {format}")]
|
||||
UnsupportedFormat { format: String },
|
||||
|
||||
#[error("I/O error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("Output file already exists: {path}")]
|
||||
OutputExists { path: PathBuf },
|
||||
|
||||
#[error("Processing error in '{operation}': {reason}")]
|
||||
Processing { operation: String, reason: String },
|
||||
|
||||
#[error("Preset error: {0}")]
|
||||
Preset(String),
|
||||
|
||||
#[error("Configuration error: {0}")]
|
||||
Config(String),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, PixstripError>;
|
||||
|
||||
Reference in New Issue
Block a user