From 40d926512375c08b648004eb67681f92c0e39800 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Mon, 12 May 2014 16:12:06 +0200 Subject: [PATCH] response sends correct mime info --- src/Intervention/Image/Response.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Intervention/Image/Response.php b/src/Intervention/Image/Response.php index e2699f5c..67ddca47 100644 --- a/src/Intervention/Image/Response.php +++ b/src/Intervention/Image/Response.php @@ -17,16 +17,18 @@ class Response public function make() { - $data = $this->image->encode($this->format, $this->quality); + $this->image->encode($this->format, $this->quality); + $data = $this->image->getEncoded(); + $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data); if (function_exists('app') && is_a($app = app(), 'Illuminate\Foundation\Application')) { $response = \Response::make($data); - $response->header('Content-Type', $this->image->mime); + $response->header('Content-Type', $mime); } else { - header('Content-Type: ' . $this->image->mime); + header('Content-Type: ' . $mime); $response = $data; }