mirror of
https://gitlab.com/octospacc/Snippets.git
synced 2025-03-12 22:50:09 +01:00
Auto-Backup $'Fri Jan 03 2025 02:33:10 GMT+0100 (Central European Standard Time)'
This commit is contained in:
parent
cf5165389d
commit
958f00da36
@ -1,7 +1,6 @@
|
|||||||
<?php http_response_code(500);
|
<?php http_response_code(500);
|
||||||
|
|
||||||
if (false
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST'
|
||||||
|| $_SERVER['REQUEST_METHOD'] !== 'POST'
|
|
||||||
|| $_SERVER['HTTP_CONTENT_TYPE'] !== 'image/bmp'
|
|| $_SERVER['HTTP_CONTENT_TYPE'] !== 'image/bmp'
|
||||||
|| !str_starts_with($_SERVER['HTTP_USER_AGENT'], 'LumaBmp2NinJpg/')
|
|| !str_starts_with($_SERVER['HTTP_USER_AGENT'], 'LumaBmp2NinJpg/')
|
||||||
) {
|
) {
|
||||||
@ -15,6 +14,13 @@ $imageTmp = imagecreatefrombmp('php://input');
|
|||||||
imagejpeg($imageTmp, $jpgFile, $jpgQuality);
|
imagejpeg($imageTmp, $jpgFile, $jpgQuality);
|
||||||
imagedestroy($imageTmp);
|
imagedestroy($imageTmp);
|
||||||
|
|
||||||
|
if ($fileName = $_SERVER['HTTP_X_FILE_NAME']) {
|
||||||
|
if ($dateTime = date_create_from_format("Y-m-d_G-i-s", explode('.', $fileName)[0])) {
|
||||||
|
$dateTime = $dateTime->format('Y:m:d G:i:s');
|
||||||
|
exec("exiftool -overwrite_original -CreateDate='{$dateTime}' -ModifyDate='{$dateTime}' -FileModifyDate='{$dateTime}' -DateTime='{$dateTime}' -DateTimeOriginal='{$dateTime}' -DateTimeDigitized='{$dateTime}' {$jpgFile}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
header('Content-Type: image/jpg');
|
header('Content-Type: image/jpg');
|
||||||
header('Content-Length: ' . filesize($jpgFile));
|
header('Content-Length: ' . filesize($jpgFile));
|
||||||
http_response_code(200);
|
http_response_code(200);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user