From 0e0846cbe3bd2487fe4dd98f4f3aa9fea48b5139 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 13 Jul 2023 19:27:25 -0500 Subject: [PATCH] Add more upload file types --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 3 +++ templates/finished_uploads.rs.html | 1 + templates/index.rs.html | 2 +- templates/thumbnails.rs.html | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76e121c..011db47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1402,7 +1402,7 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pict-rs-proxy" -version = "0.4.0-rc.2" +version = "0.5.0-alpha.0" dependencies = [ "actix-rt", "actix-web", diff --git a/Cargo.toml b/Cargo.toml index 5885459..ed59c04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pict-rs-proxy" description = "A simple web frontend for pict-rs" -version = "0.4.0-rc.2" +version = "0.5.0-alpha.0" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/src/main.rs b/src/main.rs index 1f974ba..4f6aa4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -195,6 +195,8 @@ pub enum UploadResult<'a> { #[derive(Debug, serde::Deserialize)] enum FileType { + #[serde(rename = "avif")] + Avif, #[serde(rename = "jpg")] Jpg, #[serde(rename = "webp")] @@ -204,6 +206,7 @@ enum FileType { impl FileType { fn as_str(&self) -> &'static str { match self { + Self::Avif => "avif", Self::Jpg => "jpg", Self::Webp => "webp", } diff --git a/templates/finished_uploads.rs.html b/templates/finished_uploads.rs.html index 8ca491a..d2777c2 100644 --- a/templates/finished_uploads.rs.html +++ b/templates/finished_uploads.rs.html @@ -22,6 +22,7 @@
+ @image.filename()
diff --git a/templates/index.rs.html b/templates/index.rs.html index c9dcec4..fa09241 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -21,7 +21,7 @@
Select Files
diff --git a/templates/thumbnails.rs.html b/templates/thumbnails.rs.html index 06a3325..7bbd9e8 100644 --- a/templates/thumbnails.rs.html +++ b/templates/thumbnails.rs.html @@ -52,6 +52,7 @@
+ @image.filename()

@size x @size