add variable size for images
This commit is contained in:
parent
3457314e87
commit
19beccff30
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue