From: asonix Date: Sun, 11 Oct 2020 00:31:56 +0000 (-0500) Subject: pict-rs v2 X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/hacktivis.me/readmes/README.zh.hant.md?a=commitdiff_plain;h=08588c873ad73f4ba2d18983c62872086ef896f4;p=lemmy.git pict-rs v2 --- diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index b8e35f2a..ff60d347 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -40,7 +40,7 @@ services: restart: always pictrs: - image: asonix/pictrs:v0.1.13-r0 + image: asonix/pictrs:v0.2.0-alpha.8-r0 ports: - "8537:8080" user: 991:991 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index e313c9fe..e0650547 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -37,7 +37,7 @@ services: - lemmy pictrs: - image: asonix/pictrs:v0.1.13-r0 + image: asonix/pictrs:v0.2.0-alpha.8-r0 ports: - "127.0.0.1:8537:8080" user: 991:991 diff --git a/src/routes/images.rs b/src/routes/images.rs index 110dafca..2521d0b6 100644 --- a/src/routes/images.rs +++ b/src/routes/images.rs @@ -63,7 +63,7 @@ async fn full_res( client: web::Data, ) -> Result { let url = format!( - "{}/image/{}", + "{}/image/original/{}", Settings::get().pictrs_url, &filename.into_inner() ); @@ -78,10 +78,11 @@ async fn thumbnail( let (size, file) = parts.into_inner(); let url = format!( - "{}/image/thumbnail{}/{}", + "{}/image/process.{}?src={}&thumbnail={}", Settings::get().pictrs_url, + "jpg", // this can be changed to png or webp + &file, size, - &file ); image(url, req, client).await