use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("no PNG sprites found in {0}")]
NoSprites(PathBuf),
#[error("failed to pack sprites into {width}x{height} (try a larger --max-size)")]
PackFailed {
width: u32,
height: u32,
},
#[error("sprite '{name}' is larger than the atlas ({sw}x{sh} > {aw}x{ah})")]
SpriteTooLarge {
name: String,
sw: u32,
sh: u32,
aw: u32,
ah: u32,
},
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("image error: {0}")]
Image(#[from] image::ImageError),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
}