Auto-Backup $'Thu Sep 12 2024 01:34:19 GMT+0200 (Central European Summer Time)'

This commit is contained in:
2024-09-12 01:54:22 +02:00
parent b02faa2141
commit d22046e730
4 changed files with 147 additions and 1 deletions

22
LumaBmp2NinJpgConvert.php Executable file
View File

@@ -0,0 +1,22 @@
<?php http_response_code(500);
if (false
|| $_SERVER['REQUEST_METHOD'] !== 'POST'
|| $_SERVER['HTTP_CONTENT_TYPE'] !== 'image/bmp'
|| !str_starts_with($_SERVER['HTTP_USER_AGENT'], 'LumaBmp2NinJpg/')
) {
return;
}
$jpgFile = '/tmp/php.' . rand() . microtime();
$jpgQuality = 100;
$imageTmp = imagecreatefrombmp('php://input');
imagejpeg($imageTmp, $jpgFile, $jpgQuality);
imagedestroy($imageTmp);
header('Content-Type: image/jpg');
header('Content-Length: ' . filesize($jpgFile));
http_response_code(200);
fpassthru(fopen($jpgFile, 'rb'));
unlink($jpgFile);