render images through imgproxy
This commit is contained in:
parent
d465f5ecb8
commit
8c5b68037a
2 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
use GraphQL\Server\StandardServer;
|
||||
use GraphQL\Type\Schema;
|
||||
use GraphQL\Error\DebugFlag;
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
require "./lib/config.php";
|
||||
|
@ -17,7 +18,8 @@ try {
|
|||
'schema' => $schema,
|
||||
'rootValue' => [
|
||||
'db' =>$conn,
|
||||
]
|
||||
],
|
||||
'debugFlag' => DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE,
|
||||
];
|
||||
$server = new StandardServer($serverConfig);
|
||||
|
||||
|
|
|
@ -28,7 +28,11 @@ function getSkills() {
|
|||
|
||||
// Get the actual presigned-url
|
||||
$downloadURL = (string) $presignedRequest->getUri();
|
||||
array_push($response, $downloadURL);
|
||||
$encodedUrl = rtrim(strtr(base64_encode($downloadURL), '+/', '-_'), '=');
|
||||
$path = "/rs:fit:0:80:1/g:no/{$encodedUrl}.png";
|
||||
|
||||
$signature = rtrim(strtr(base64_encode(hash_hmac('sha256', $imgProxySalt.$path, $imgProxyKey, true)), '+/', '-_'), '=');
|
||||
array_push($response, $imgProxyUrl . "/" . $signature . $path);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue