diff --git a/app/Controllers/Api/Images/Compress.php b/app/Controllers/Api/Images/Compress.php index ca21955..d299b10 100644 --- a/app/Controllers/Api/Images/Compress.php +++ b/app/Controllers/Api/Images/Compress.php @@ -78,7 +78,14 @@ class Compress { if ($compressed_image_data) { file_put_contents($cache_filename, $compressed_image_data); } 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; } }