From 19beccff300115fa23bcb1e61766c4e8fdc872be Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Sun, 1 May 2022 13:13:10 +0200 Subject: [PATCH] add variable size for images --- public/API/queries/imgproxy.php | 2 +- public/API/queries/skills.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/API/queries/imgproxy.php b/public/API/queries/imgproxy.php index aa23221..f1d3e03 100644 --- a/public/API/queries/imgproxy.php +++ b/public/API/queries/imgproxy.php @@ -3,7 +3,7 @@ function imgproxy($imageURL) { require "./lib/config.php"; $encodedUrl = rtrim(strtr(base64_encode($imageURL), '+/', '-_'), '='); - $path = "/rs:fit:0:512:1/g:no/{$encodedUrl}.webp"; + $path = "/rs:fit:0:$defaultImageWidth:1/g:no/{$encodedUrl}.webp"; $signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '='); return $imgProxyUrl . "/" . $signature . $path; diff --git a/public/API/queries/skills.php b/public/API/queries/skills.php index db8fd10..480a999 100644 --- a/public/API/queries/skills.php +++ b/public/API/queries/skills.php @@ -29,7 +29,7 @@ function getSkills() { // Get the actual presigned-url $downloadURL = (string) $presignedRequest->getUri(); $encodedUrl = rtrim(strtr(base64_encode($downloadURL), '+/', '-_'), '='); - $path = "/rs:fit:0:80:1/g:no/{$encodedUrl}.webp"; + $path = "/rs:fit:0:$defaultSkillsWidth:1/g:no/{$encodedUrl}.webp"; $signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '='); array_push($response, $imgProxyUrl . "/" . $signature . $path);