PrestaShop error: image format not recognized, allowed formats are: .gif, .jpg, .png

Had issues uploading images to a prestashop install after a server upgrade.

The error message was: image format not recognized, allowed formats are: .gif, .jpg, .png

Open images.inc.php and go to about line 84 where you see this code:

// is it a picture ?    
return $mime_type && in_array($mime_type, $types);

Change it to this:

$mime_type = preg_replace('/;scharset.*$/','',$mime_type);
// is it a picture ?
return $mime_type && in_array($mime_type, $types);
 

Doneski

Leave a Reply

Your email address will not be published. Required fields are marked *