]> Untitled Git - lemmy.git/commitdiff
pict-rs v2
authorasonix <asonix@asonix.dog>
Sun, 11 Oct 2020 00:31:56 +0000 (19:31 -0500)
committerasonix <asonix@asonix.dog>
Sun, 11 Oct 2020 00:31:56 +0000 (19:31 -0500)
docker/dev/docker-compose.yml
docker/prod/docker-compose.yml
src/routes/images.rs

index b8e35f2ac4f4fd89741d7331aea7a87b5d702218..ff60d347a1f30863c81fa76406c6f50332616e0b 100644 (file)
@@ -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
index e313c9fe043126bbdc1974c175e5ea1c2345d173..e06505473972d66c91abbed6b6d6d68f8f598176 100644 (file)
@@ -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
index 110dafcaa50099742bf495486005306ae86be779..2521d0b66df7adfa87ffe09328654a11fe8e58eb 100644 (file)
@@ -63,7 +63,7 @@ async fn full_res(
   client: web::Data<Client>,
 ) -> Result<HttpResponse, Error> {
   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