Update Compress.php

This commit is contained in:
themohooks 2024-07-18 18:49:54 +03:00
parent 83921ae1d3
commit 485b61991a

View file

@ -78,7 +78,14 @@ class Compress {
if ($compressed_image_data) { if ($compressed_image_data) {
file_put_contents($cache_filename, $compressed_image_data); file_put_contents($cache_filename, $compressed_image_data);
} else { } else {
echo "Произошла ошибка при сжатии изображения."; $imageData = file_get_contents($_GET['url']);
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->buffer($imageData);
header("Content-Type: $mimeType");
echo $imageData;
exit; exit;
} }
} }