HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Alt-Svc: h3=":443"; ma=2592000
Cache-Control: max-age=31536000
Cache-Control: public
Cache-Control: public, max-age=31536000, immutable
Content-Length: 7703
Content-Type: application/x-httpd-php
Date: Sun, 16 Jun 2024 01:40:45 GMT
Etag: "1e17-5f203ff7e5629"
Expires: Tue, 16 Jan 2024 14:49:32 GMT
Last-Modified: Wed, 11 Jan 2023 21:51:08 GMT
Pragma: public
Server: Caddy
Server: nginx/1.24.0
X-Cache-Status-Fr: HIT
X-Cache-Status-Main: HIT
X-Location-Block: default
SSL Certificate
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
90:e0:1a:9c:bb:14:b6:4b:02:a8:b9:a2:28:47:fb:83
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN=Caddy Local Authority - ECC Intermediate
Validity
Not Before: Jun 15 21:03:09 2024 GMT
Not After : Jun 16 09:03:09 2024 GMT
Subject:
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:59:e5:31:2a:a5:68:cf:dc:c7:3c:ee:0a:b3:c4:
39:7c:5b:f1:70:af:c5:ae:3e:96:7c:bd:76:46:c4:
24:16:0e:01:e0:66:2a:38:f1:2f:86:4f:9e:b7:2c:
73:f5:04:95:c0:5d:bc:9f:3a:8c:2a:63:f4:1a:bd:
17:23:9d:81:09
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Subject Key Identifier:
D1:67:2D:3D:A9:D1:9D:80:7B:CB:F9:9F:F4:62:C8:BF:28:1A:DB:EF
X509v3 Authority Key Identifier:
06:B8:FE:A1:21:80:89:77:78:DA:CE:6D:59:6D:A5:23:ED:07:93:2F
X509v3 Subject Alternative Name: critical
IP Address:89.233.108.10
Signature Algorithm: ecdsa-with-SHA256
Signature Value:
30:45:02:20:63:4f:81:05:0f:7f:33:8d:f0:28:2c:67:8f:67:
f9:c2:5e:1a:12:61:cb:86:ea:a4:ed:64:37:ee:85:3f:90:78:
02:21:00:98:25:85:4d:ad:e9:b3:97:4b:1f:a9:c9:27:5a:19:
d0:17:4f:ba:9e:83:05:8b:dd:8b:81:3d:e7:f2:54:ef:f8
HTTP/1.1 200 OK
Server: nginx/1.24.0
Date: Thu, 13 Jun 2024 07:49:18 GMT
Content-Type: application/x-httpd-php
Content-Length: 7703
Connection: keep-alive
Last-Modified: Wed, 11 Jan 2023 21:51:08 GMT
ETag: "1e17-5f203ff7e5629"
Expires: Tue, 16 Jan 2024 14:49:32 GMT
Cache-Control: max-age=31536000
X-Cache-Status-Main: HIT
Pragma: public
Cache-Control: public
Access-Control-Allow-Origin: *
X-Location-Block: default
X-Cache-Status-fr: HIT
Cache-Control: public, max-age=31536000, immutable
Accept-Ranges: bytes
<?php
/* ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/
include_once ('/var/www/html/image_server/classes/ImageServer.class.php');
$folderImages = '/ghbackup/moderation';
$oImageServer = new ImageServer();
$urlData = parse_url($_SERVER['REQUEST_URI']);
if (isset($urlData['query']))
$queries = explode('&', $urlData['query']);
else
$queries = array();
$count = count($queries);
if(!($count>0)){
header("HTTP/1.0 400 Bad Request");
die();
}
foreach ($queries as $k => $i) {
if (strpos($queries[$k], 'crop') !== false) {
$tmp = explode('crop=', $queries[$k]);
if (isset($tmp[1]))
$aRequest['crop'] = $tmp[1];
}
if (strpos($queries[$k], 'resize') !== false) {
$t = explode('resize=', $queries[$k]);
if (isset($t[1])) {
$aRequest['resize'] = str_replace(',fill', '', $t[1]);
$tmp=explode('x', $aRequest['resize']);
if($tmp[1]==1)
$aRequest['resize']=$tmp[0].'x'.$tmp[0]/2;
if(is_array($tmp) && empty($tmp[1])){
$rh=$tmp[0]/2;
$aRequest['resize']= $aRequest['resize'].$rh;
}
}
}
if (strpos($queries[$k], 'save') !== false)
$GET['save'] = explode('save=', $queries[$k])[1];
if (strpos($queries[$k], 'pad') !== false)
$GET['pad'] = explode('pad=', $queries[$k])[1];
}
$aRequest['image_path'] = $folderImages . ($urlData['path'] ?? $urlData['path'] ?? null);
$resolution = '8k';
$bUseEqImage=0;
$version=-1;
if (isset($GET['pad'])){
$version=intVal(str_replace('bg:','',$GET['pad']));
if (strpos($GET['pad'], 'bg:000016') !== false)
$resolution = '16k';
}
if (isset($GET['save'])) {
$a = explode(',qual:', $GET['save']);
if (is_array($a) && (isset($a[1]) && strlen($a[1]) > 0) && (isset($aRequest['crop']) || isset($aRequest['resize'])))
$aRequest['quality'] = intVal($a[1]);
else
$aRequest['quality'] = 70;
}
if (isset($GET['pad']))
if (strpos($GET['pad'], 'bg:640000') !== false && strpos($aRequest['image_path'], 'cube') != false)
$bUseEqImage=1;
$aRequest['format'] = pathinfo($aRequest['image_path'], PATHINFO_EXTENSION);
$bIsTourPreview = 0;
if (strpos($aRequest['image_path'], 'cube') != false && empty($aRequest['crop'])) {
if (strpos($aRequest['image_path'], '_thumb_') !== false)
$bIsTourPreview = 1;
}
// echo strpos($aRequest['image_path'],'_thumb_');die;
if (empty($aRequest['image_path'])) {
header("HTTP/1.0 400 Bad Request");
die();
}
$tile = '';
$resize = '';
if (! empty($aRequest['crop']))
$tile = $oImageServer->getTileName($aRequest['crop'], $resolution);
if (! empty($aRequest['resize']))
$resize = $aRequest['resize'];
if (strpos($aRequest['image_path'], '_thumb') !== false && !empty($aRequest['resize']) && $aRequest['resize']=='1500x750'){
$resize ='1000x500';
$aRequest['resize']=$resize;
}
//print_r($aRequest);die;
$bIsCubeRequest = $oImageServer->isCubeRequest($aRequest['image_path']);
if(!$bIsCubeRequest && $version>0){
$aRequest['image_version']=$version;
}else
$aRequest['image_version']='';
//print_r($aRequest);die;
$request = $oImageServer->preProcessRequest($aRequest);
if (isset($request['image_type']))
if ($request['image_type'] != 'image/jpeg' || $bIsTourPreview)
$aRequest['quality'] = '';
if (empty($aRequest['crop']) && empty($aRequest['resize']))
$aRequest['quality'] = '';
if ($bIsTourPreview)
$aRequest['quality'] = '';
if(isset($request['image_type']) && $request['image_type'] != 'image/jpeg')
$resize='';
// print_r( $request['image_type'] );die;
$hVer='';
if(!empty($aRequest['image_version']))
$hVer='v'.$aRequest['image_version'];
$sImagePathGPU = str_replace("ghbackup/moderation", "data/moderation", $aRequest['image_path']);
//echo $sImagePathGPU . $tile . $resize . $aRequest['quality'] . $aRequest['format'] .$hVer; die;
$hashKey = md5($sImagePathGPU . $tile . $resize . $aRequest['quality'] . $aRequest['format'] .$hVer);///* . */
// $hashKey = md5($aRequest['image_path'] . $tile . $resize . $aRequest['quality'] . $aRequest['format']);
// echo $aRequest['image_path'] . $tile .