Compare commits

...

3 commits

Author SHA1 Message Date
asonix 113992cdc8 Update version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-07-13 20:05:05 -05:00
asonix 5089122248 Add support for more file types 2023-07-13 20:01:47 -05:00
asonix 9b173bd11b Update flake 2023-07-13 19:41:50 -05:00
7 changed files with 16 additions and 13 deletions

2
Cargo.lock generated
View file

@ -1521,7 +1521,7 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "pict-rs-aggregator"
version = "0.4.0-rc.2"
version = "0.5.0-alpha.0"
dependencies = [
"actix-rt",
"actix-web",

View file

@ -1,7 +1,7 @@
[package]
name = "pict-rs-aggregator"
description = "A simple image aggregation service 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"

View file

@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1684935479,
"narHash": "sha256-6QMMsXMr2nhmOPHdti2j3KRHt+bai2zw+LJfdCl97Mk=",
"lastModified": 1689192006,
"narHash": "sha256-QM0f0d8oPphOTYJebsHioR9+FzJcy1QNIzREyubB91U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f91ee3065de91a3531329a674a45ddcb3467a650",
"rev": "2de8efefb6ce7f5e4e75bdf57376a96555986841",
"type": "github"
},
"original": {

View file

@ -1,14 +1,12 @@
{ lib
, makeWrapper
, nixosTests
, protobuf
, rustPlatform
, stdenv
}:
rustPlatform.buildRustPackage {
pname = "pict-rs-aggregator";
version = "0.4.0-rc.2";
version = "0.5.0-alpha.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;

View file

@ -93,7 +93,7 @@ pub struct Config {
}
pub fn accept() -> &'static str {
"image/png,image/jpeg,image/webp,.jpg,.jpeg,.png,.webp"
"image/apng,image/avif,image/gif,image/png,image/jpeg,image/jxl,image/webp,.apng,.avif,.gif,.jpg,.jpeg,.jxl,.png,.webp"
}
impl Config {
@ -787,7 +787,7 @@ async fn view_collection(
)
}
#[tracing::instrument(name = "Edit Collection")]
#[tracing::instrument(name = "Edit Collection", skip(req))]
async fn edit_collection(
path: web::Path<CollectionPath>,
token: ValidToken,

View file

@ -1,5 +1,8 @@
#[derive(Clone, Copy, Debug, serde::Deserialize)]
pub(crate) enum Extension {
#[serde(rename = "avif")]
Avif,
#[serde(rename = "jpg")]
Jpg,
@ -10,6 +13,7 @@ pub(crate) enum Extension {
impl std::fmt::Display for Extension {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Avif => write!(f, "avif"),
Self::Jpg => write!(f, "jpg"),
Self::Webp => write!(f, "webp"),
}

View file

@ -6,6 +6,7 @@
<div class="image-box">
<picture>
<source type="image/webp" srcset="@state.srcset(filename, Extension::Webp)" />
<source type="image/avif" srcset="@state.srcset(filename, Extension::Avif)" />
<source type="image/jpeg" srcset="@state.srcset(filename, Extension::Jpg)" />
<img src="@state.image_path(filename)" @if let Some(title)=entry.title.as_ref() { title="@title" } @if let
Some(description)=entry.description.as_ref() { alt="@description" } />