Skip to content

Commit 8a1773b

Browse files
committed
Merge pull request #11 from olegpopadko/content_type_set
Use php image_type_to_mime_type function to detect Content-Type
2 parents 6d8e887 + 0fa2d30 commit 8a1773b

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/ImageResize.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,7 @@ public function output($image_type = null, $quality = null)
138138
{
139139
$image_type = $image_type ?: $this->source_type;
140140

141-
switch ($image_type) {
142-
case IMAGETYPE_GIF:
143-
$content_type = 'image/gif';
144-
break;
145-
146-
case IMAGETYPE_JPEG:
147-
$content_type = 'image/jpeg';
148-
break;
149-
150-
case IMAGETYPE_PNG:
151-
$content_type = 'image/png';
152-
break;
153-
}
154-
155-
header('Content-Type: ' . $content_type);
141+
header('Content-Type: ' . image_type_to_mime_type($image_type));
156142

157143
$this->save(null, $image_type, $quality);
158144
}

0 commit comments

Comments
 (0)