Jump to content

For those with product image upload - image format not recognized, allowed formats are: .gif, .jpg, .png


Recommended Posts

I ran into that problem on both 1.2.5 and 1.3.1.1

Here is the small fix I did and solved my problem:

open images.inc.php

find this arround line 72

   if (function_exists('finfo_open'))
   {
       $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
       $finfo = finfo_open($const);
       $mime_type = finfo_file($finfo, $file['tmp_name']);
       finfo_close($finfo);
   }
   elseif (function_exists('mime_content_type'))
       $mime_type = mime_content_type($file['tmp_name']);



and replace with this:

   if (function_exists('mime_content_type'))
       $mime_type = mime_content_type($file['tmp_name']);

   elseif (function_exists('finfo_open'))
   {
       $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
       $finfo = finfo_open($const);
       $mime_type = finfo_file($finfo, $file['tmp_name']);
       finfo_close($finfo);
   }



Hope it helps somebody.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...