Jump to content

<SOLVED> Images Are not Getting Updated in Version 1.3.5.0 - 2.117s


Recommended Posts

Hi Friends,

I am trying to update my shop logo or homepage logo. I am getting error as " image format not recognized, allowed formats are: .gif, .jpg, .png" whereas I am using same formats which are suitable.

Regards
Vilas

Link to comment
Share on other sites

Hi Friendsl,
I have a similar problem.....not only with the homepage_logo, but all image uploads through the Back office admin tool. I am a newbie....and just installed 1.3.5.0 because I understood that this is a stable version? So Iam guessing this version must be bug free.

I checked to see it the CHMOD 777 permisions are applied to the directories and subdirectories ...aand they have write permissions. What am I missing.Please help!

Link to comment
Share on other sites

Hi,

But is there any solution to remove this bug? Actually some customers are registered on my sites due to which not able to delete complete installed version. So if you help me to know more about how to take backup of existing customers data then it will be helpful to me to remove this version and install to latest one.

Regards
Vilas

Link to comment
Share on other sites

The solution is to overwrite your images.inc.php file with the one from PrestaShop v1.3.4, which you can download from here.

The related bug report is here. Bruno should have been notified of the comments on that report that the bug fix isn't working. Hopefully, the issue will be fixed soon.

Link to comment
Share on other sites

Bruno has posted a solution on the bug tracker and wants it tested on as many servers affected by the issue as possible. The fix worked for me. Does it work for you too?

You should replace the isPicture function in images.inc.php with the following:

/**
* Check image MIME type
*
* @param string $file $_FILE of the current file
* @param array $types Allowed MIME types
*/
function isPicture($file, $types = NULL)
{
   /* Detect mime content type */
   $mimeType = false;
   if (!$types)
       $types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
   /* Try 4 different methods to determine the mime type */
   if (function_exists('finfo_open'))
   {
       $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
       $finfo = finfo_open($const);
       $mimeType = finfo_file($finfo, $file['tmp_name']);
       finfo_close($finfo);
   }
   elseif (function_exists('mime_content_type'))
   {
       $mimeType = mime_content_type($file['tmp_name']);
   }
   elseif (function_exists('exec'))
   {
       $mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name'])));
       if (!$mimeType)
           $mimeType = trim(exec('file --mime '.escapeshellarg($file['tmp_name'])));
       if (!$mimeType)
           $mimeType = trim(exec('file -bi '.escapeshellarg($file['tmp_name'])));
   }
   if (empty($mimeType) OR $mimeType == 'regular file')
       $mimeType = $file['type'];
       /* For each allowed MIME type, we are looking for it inside the current MIME type */
   foreach ($types AS $type)
       if (strstr($mimeType, $type))
           return true;
       return false;
}

Link to comment
Share on other sites

MYSTERY SOLVED.

thanks for the info re missing images.

Upgraded from 1.2.5.0 > 1.3.5.0 everything seems ok except for image problem.

Problem: maybe 10% of the images seem to have gone missing in action - coming back with the [?] image 404 replacement image - I have checked and the 'real' images are all where they should be..

Applied the isPicture fix - not working for us :(

Ideas?

Link to comment
Share on other sites

  • 2 months 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...