- // Resize only if its not a GIF
- if ($mime != "image/gif") {
- $ph = new Photo($data, $mimetype);
- if($ph->is_valid()) {
- if(isset($customres) && $customres > 0 && $customres < 500) {
- $ph->scaleImageSquare($customres);
+ // Resize only if its not a GIF and it is supported by the library
+ if ($mimetype != "image/gif" && in_array($mimetype, Image::supportedTypes())) {
+ $Image = new Image($data, $mimetype);
+ if ($Image->isValid()) {
+ if (isset($customres) && $customres > 0 && $customres < 500) {
+ $Image->scaleToSquare($customres);