Vilas Posted January 2, 2011 Share Posted January 2, 2011 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.RegardsVilas Link to comment Share on other sites More sharing options...
dtg_ca Posted January 2, 2011 Share Posted January 2, 2011 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 More sharing options...
tomerg3 Posted January 2, 2011 Share Posted January 2, 2011 It seems to be a bug with a new mime type system that was added.I haven't checked it too deeply, but I believe that copying the files that handle the upload from PS 1.3.4 should fix it. Link to comment Share on other sites More sharing options...
Vilas Posted January 2, 2011 Author Share Posted January 2, 2011 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.RegardsVilas Link to comment Share on other sites More sharing options...
rocky Posted January 3, 2011 Share Posted January 3, 2011 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 More sharing options...
Vilas Posted January 3, 2011 Author Share Posted January 3, 2011 Hi Rocky,You done again. Got the solution.RegardsVilas Link to comment Share on other sites More sharing options...
rocky Posted January 4, 2011 Share Posted January 4, 2011 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 More sharing options...
Oncle_Dave Posted January 4, 2011 Share Posted January 4, 2011 This worked well for me.Thank you.David RolinRD Serviceshttp://www.rd-services.be Link to comment Share on other sites More sharing options...
theothersimon Posted January 5, 2011 Share Posted January 5, 2011 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 More sharing options...
mileniaz Posted January 5, 2011 Share Posted January 5, 2011 is prestashop 1.3.5 only updated file images.inc.php from 1.3.4im currently using 1.3.4, and i only replace image.inc.php from 1.3.5. so far system working without problem, even upload image, thereis no problem like this Link to comment Share on other sites More sharing options...
Clement Ha Posted January 10, 2011 Share Posted January 10, 2011 Works for me! Thanks rocky! Link to comment Share on other sites More sharing options...
brutus36 Posted March 31, 2011 Share Posted March 31, 2011 Where would we be without you rocky! Link to comment Share on other sites More sharing options...
brutus36 Posted March 31, 2011 Share Posted March 31, 2011 Was also going to say that it didn't happen on local server, only once live. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now