image_blp/encode/
error.rs

1use crate::types::BlpVersion;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum Error {
6    #[error("BLP supports width up to 65,535, the width: {0}")]
7    WidthTooHigh(u32),
8    #[error("BLP supports height up to 65,535, the width: {0}")]
9    HeightTooHigh(u32),
10    #[error("External mipmaps are not supported for the version {0}")]
11    ExternalMipmapsNotSupported(BlpVersion),
12    #[error("Invalid offset {offset} for mipmap {mipmap}, filled bytes {filled}")]
13    InvalidOffset {
14        mipmap: usize,
15        offset: usize,
16        filled: usize,
17    },
18    #[error("Size of mipmap {mipmap} in header {in_header} doesn't match actual {actual}")]
19    InvalidMipmapSize {
20        mipmap: usize,
21        in_header: usize,
22        actual: usize,
23    },
24    #[error("Failed to proceed {0}, due: {1}")]
25    FileSystem(std::path::PathBuf, std::io::Error),
26    #[error("Name of root file is malformed: {0}")]
27    FileNameInvalid(std::path::PathBuf),
28}