Add more upload file types
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
43e7a6a2fe
commit
0e0846cbe3
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -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",
|
||||
|
|
|
@ -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 <asonix@asonix.dog>"]
|
||||
license = "AGPL-3.0"
|
||||
readme = "README.md"
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<div class="imagebox">
|
||||
<picture>
|
||||
<source type="image/webp" srcset="@image.thumb(800, FileType::Webp)" />
|
||||
<source type="image/avif" srcset="@image.thumb(800, FileType::Avif)" />
|
||||
<img src="@image.thumb(800, FileType::Jpg)" alt="@image.filename()" title="@image.filename()" />
|
||||
</picture>
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<div class="button plain">
|
||||
<span id="file-upload-text">Select Files</span>
|
||||
<input id="file-upload-input" type="file" name="@name"
|
||||
accept="image/png,image/gif,image/jpeg,image/webp,video/mp4,video/quicktime,.jpg,.jpeg,.png,.gif,.webp,.m4v,.mp4"
|
||||
accept="image/apng,image/avif,image/png,image/gif,image/jpeg,image/jxl,image/webp,video/mp4,video/quicktime,video/webm,.apng,.avif,.jpg,.jpeg,.jxl,.png,.gif,.webp,.m4v,.mp4,.webm"
|
||||
multiple />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
<article>
|
||||
<picture>
|
||||
<source type="image/webp" srcset="@image.thumb(*size, FileType::Webp)" />
|
||||
<source type="image/avif" srcset="@image.thumb(*size, FileType::Avif)" />
|
||||
<img src="@image.thumb(*size, FileType::Jpg)" alt="@image.filename()" title="@image.filename()" />
|
||||
</picture>
|
||||
<p>@size x @size</p>
|
||||
|
|
Loading…
Reference in a new issue