We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cadf1f commit 2783e2fCopy full SHA for 2783e2f
src/ImageResize.php
@@ -98,7 +98,17 @@ public function loadFromString($imagedata)
98
$this->source_type
99
) = $image_info;
100
101
- $this->source_image = imagecreatefromstring($imagedata);
+ switch ($this->source_type) {
102
+ case IMAGETYPE_GIF:
103
+ case IMAGETYPE_JPEG:
104
+ case IMAGETYPE_PNG:
105
+ $this->source_image = imagecreatefromstring($imagedata);
106
+ break;
107
+
108
+ default:
109
+ throw new \Exception('Unsupported image type');
110
111
+ }
112
113
return $this->resize($this->getSourceWidth(), $this->getSourceHeight());
114
}
0 commit comments