Profile picture processing

This is still single-threaded, so perf is pretty bad. Will need to think
about how to do this more efficiently in a web context where we don't
have threading.
This commit is contained in:
William Casarin
2023-07-05 18:15:15 -07:00
parent 453e8b7002
commit e17b73abab
4 changed files with 86 additions and 47 deletions

View File

@@ -1,9 +1,10 @@
use shatter::parser;
#[derive(Eq, PartialEq, Debug)]
#[derive(Debug)]
pub enum Error {
Nostr(enostr::Error),
Shatter(parser::Error),
Image(image::error::ImageError),
Generic(String),
}
@@ -19,6 +20,12 @@ impl From<parser::Error> for Error {
}
}
impl From<image::error::ImageError> for Error {
fn from(err: image::error::ImageError) -> Self {
Error::Image(err)
}
}
impl From<enostr::Error> for Error {
fn from(err: enostr::Error) -> Self {
Error::Nostr(err)