wildchief Posted December 23, 2010 Share Posted December 23, 2010 Hello Forum,I had just upgraded from 1.3.2 to 1.3.4 on a system that I am about to go live with. It works well except the image upload (manufacturers, products, catalog categories). I receive the error 1 error 1. image format not recognized, allowed formats are: .gif, .jpg, .pngWhen attempting an image upload.The site shares a server with another prestashop install - version 1.3.1.1 which does not have the problem. Nothing is displayed in the error_log The permissions on the img and sub dirs is 777 Any ideas?Some of the threads which show othes having similar problems suggest it to be permissions related or even suggest commenting parts of the images.inc.php file.Does anyone have a suggestion?Thank youDavid Link to comment Share on other sites More sharing options...
cessargor Posted December 23, 2010 Share Posted December 23, 2010 i have same problem with the images upload, any suggestions please? Link to comment Share on other sites More sharing options...
razaro Posted December 23, 2010 Share Posted December 23, 2010 For me commenting these lines worked but I know it is not right solution //if (!isPicture($file)) // return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png'); Link to comment Share on other sites More sharing options...
cessargor Posted December 23, 2010 Share Posted December 23, 2010 what file did you edit? Link to comment Share on other sites More sharing options...
wildchief Posted December 23, 2010 Author Share Posted December 23, 2010 For now I have rolled the files back to 1.3.2.3. I still have the updated 1.3.4 database but it all works okay. However I will restore back to a previous 1.3.2 backup tonight when I get time. Obviously a bit worried Link to comment Share on other sites More sharing options...
wildchief Posted December 23, 2010 Author Share Posted December 23, 2010 Hello Razaro did you do this on version 1.3.4? Its' weird becasue my 1.3.2 version works great. For me commenting these lines worked but I know it is not right solution //if (!isPicture($file)) // return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png'); Link to comment Share on other sites More sharing options...
wildchief Posted December 23, 2010 Author Share Posted December 23, 2010 The file, I believe is images.inc.php, I was not keen on editing it as it would be a kind of hack so will stay at previous version for nowTaDave what file did you edit? Link to comment Share on other sites More sharing options...
wildchief Posted December 23, 2010 Author Share Posted December 23, 2010 For everyones info I am running on a Centos 5 VPS server running PHP 5.1 Link to comment Share on other sites More sharing options...
razaro Posted December 23, 2010 Share Posted December 23, 2010 Sorry, forgot to mention I did that for 1.3.2.3 version on my server, but didn't test it in any other version.And yes i agree that is hack and it is not right solution.Edit: just checked images.inc.php in 1.4.05 and function isPicture is different. Link to comment Share on other sites More sharing options...
wildchief Posted December 23, 2010 Author Share Posted December 23, 2010 Okay so you got the problem with 1.3.2.3 and I didn't with that version I only got it with 1.3.4. I might try your Hack or perhaps leave the site on 1.3.2 until version 1.4. Not sure what to do! Sorry, forgot to mention I did that for 1.3.2.3 version on my server, but didn't test it in any other version.And yes i agree that is hack and it is not right solution.Edit: just checked images.inc.php in 1.4.05 and function isPicture is different. Link to comment Share on other sites More sharing options...
cessargor Posted December 23, 2010 Share Posted December 23, 2010 i just tried the hack, works perfect, thank you.//if (!isPicture($file)) // return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png'); check my sitehttp://comprasanandres.com/index.php Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 23, 2010 Share Posted December 23, 2010 Hello,Searching on internet I found a solution that I posted at the end of this bug report:http://www.prestashop.com/bug_tracker/view/6435/I don't know if it works for you. Let us know. Link to comment Share on other sites More sharing options...
Jameh Posted December 24, 2010 Share Posted December 24, 2010 the solution is worked. //if (!isPicture($file)) // return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png'); But I don't think is right solution. Hope there is another prefect way. Link to comment Share on other sites More sharing options...
razaro Posted December 24, 2010 Share Posted December 24, 2010 Hello,Searching on internet I found a solution that I posted at the end of this bug report:http://www.prestashop.com/bug_tracker/view/6435/I don't know if it works for you. Let us know. Thanks for link. I tried that solution and it didn't worked for me. (1.3.2.3)Done some searching and tests and think I got other solution.My PHP version is 5.2.14 and Fileinfo is not inculcated so first test from isPicture function is false.Second one mime_content_type returns text/plain for png image and that seams cause problem, that few people had that function.And third option trim(exec(... works for me so I just changed order to elseif (function_exists('exec')) $mime_type = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name']))); elseif (function_exists('mime_content_type')) $mime_type = mime_content_type($file['tmp_name']); And it is working, for now at least :-)Don't know about other PresatShop versions. Link to comment Share on other sites More sharing options...
TropischBruin Posted December 24, 2010 Share Posted December 24, 2010 This error occurs in the latest v1.4.0.5 beta to. Link to comment Share on other sites More sharing options...
wildchief Posted December 24, 2010 Author Share Posted December 24, 2010 Well I am goin gto stay at 1.3.2 for now i restored the DB so I am back to where i was. I will have to watch this subject closely before attempting another upgraded Link to comment Share on other sites More sharing options...
Fant63 Posted December 24, 2010 Share Posted December 24, 2010 images.inc.php if (!$mime_type) $mime_type = trim(exec('file -bi '.escapeshellarg($file['tmp_name']))); else $mime_type = trim(exec('file --mime '.escapeshellarg($file['tmp_name']))); Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 25, 2010 Share Posted December 25, 2010 Hi Fant63,What version of PHP do you have?Here is another solution. Does it works for you?http://dtbaker.com.au/random-bits/prestashop-error-image-format-not-recognized-allowed-formats-are-.gif-.jpg-.png.html// 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);Thank you, Link to comment Share on other sites More sharing options...
Fant63 Posted December 25, 2010 Share Posted December 25, 2010 Hi Igor Schlumberger What version of PHP do you have? version of PHP 5.2.12 http://hefesto.timeweb.ru/phpinfo.phpHere is another solution. Does it works for you? No, same error (( Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 25, 2010 Share Posted December 25, 2010 Hi Fant63,Thank you for that. We will investigate. I will try to open a website on timeweb.ru to debug the issue. Link to comment Share on other sites More sharing options...
Fant63 Posted December 25, 2010 Share Posted December 25, 2010 There is free access for 10 days Link to comment Share on other sites More sharing options...
chipset Posted December 27, 2010 Share Posted December 27, 2010 Just for information: On 1.3.2 every is OK, on clear new 1.3.4 in the same server, I have the same problem with the images upload. My PHP version is 5.3.2Edit: I try with chmod 777 in the all prestashop directory, the problem still exist. Link to comment Share on other sites More sharing options...
Fant63 Posted December 27, 2010 Share Posted December 27, 2010 I also did not change the serverupdated prestashop v1.3.3>> v1.3.4 Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 27, 2010 Share Posted December 27, 2010 This bug should be fixed in the latest svn. (both for 1.3 and 1.4) Could you please just replace the images.inc.php from SVN and tell if it solve the problem you encounter.Thank you. Link to comment Share on other sites More sharing options...
ukbill69 Posted December 28, 2010 Share Posted December 28, 2010 I have installed a fresh install on 1.3.4 and still get error "image format not recognized, allowed formats are: .gif, .jpg, .png"when uploading any type of gif, jpg file.I have downloaded again the latest zip file and uploaded images.inc.php again and still get this problem. Link to comment Share on other sites More sharing options...
chipset Posted December 28, 2010 Share Posted December 28, 2010 ...I have downloaded again the latest zip file and uploaded images.inc.php again and still get this problem.I think so Igor wont to download this file http://svn.prestashop.com/branches/1.3.x/images.inc.phpIn my case the problem is solved, thank you. Link to comment Share on other sites More sharing options...
ukbill69 Posted December 28, 2010 Share Posted December 28, 2010 thanks, now working. Link to comment Share on other sites More sharing options...
wildchief Posted December 28, 2010 Author Share Posted December 28, 2010 Hello,I have replaced the file and this has resolved the problem for me. This is great news as I can launch my site with the latest release as scheduled this new year.Cheers for all the efforts Dave Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 29, 2010 Share Posted December 29, 2010 Prestashop Team just released a version 1.3.5 with just this modification, so there is no known regression from 1.3.3 Link to comment Share on other sites More sharing options...
Justus Posted December 30, 2010 Share Posted December 30, 2010 I downloaded the file, replaced the old one but it doesn't work for me (1.3.5).Going to install the 1.3.2 version now. Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 30, 2010 Share Posted December 30, 2010 Bad news. What appends if you keep version 1.3.5 and just keep the images.inc.php file from the 1.3.2 version to see if it works.Can you send me your ftp access in PM, we will debug the system and see why it still doesn't work.Thank you for your help. Link to comment Share on other sites More sharing options...
littlez Posted December 31, 2010 Share Posted December 31, 2010 Have the same problem with 1.3.5 and 1.4b2. Both with clean installs. Installed images.inc.php from 1.3.3 and that fixed the problem. Link to comment Share on other sites More sharing options...
littlez Posted December 31, 2010 Share Posted December 31, 2010 My server is running CentOS and PhP 5.2.14. (1.3.5 and 1.4 b2 doesn't work)My laptop is running Suse 11.3 and PhP 5.3.3. ( 1.3.5 and 1.4 b2 works fine) Link to comment Share on other sites More sharing options...
chipset Posted December 31, 2010 Share Posted December 31, 2010 I downloaded the file, replaced the old one but it doesn't work for me (1.3.5).Going to install the 1.3.2 version now.After replace the new file, delete all without index.php from /your site/tools/smarty/compile and cache on your browser. Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 31, 2010 Share Posted December 31, 2010 @littlez,Could you please give me an ftp access in Private Message to a prestashop folder with 1.3.5 installed? So we could debug the problem on your system configuration.@chipset,I don't think that smarty is involved. Because the error occurs when you upload a PNG for the logo of the shop. The file is not recognized as a PNG by the backOffice.Regards, Link to comment Share on other sites More sharing options...
littlez Posted December 31, 2010 Share Posted December 31, 2010 Installed images.inc.php from 1.3.3 and that fixed the problem. Do you still want access with the non-working 1.3.5? I will set up 1.3.5 on one of my other sites if you want? Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted December 31, 2010 Share Posted December 31, 2010 Yes thank you! it will help. An access to a new Prestashop 1.3.5 will be very nice. So we can finish with this png files not being recognized. It seems so basic to get that work, but there is so much version of PHP and Apache with each time small bugs. I now the same thing with Prestashop. That's the OpenSource software industry. Link to comment Share on other sites More sharing options...
littlez Posted December 31, 2010 Share Posted December 31, 2010 I'm working on it right now. This applies to .jpg and png. Link to comment Share on other sites More sharing options...
littlez Posted December 31, 2010 Share Posted December 31, 2010 This will take me some time because I am on satellite. Link to comment Share on other sites More sharing options...
aumatco Posted January 1, 2011 Share Posted January 1, 2011 same problem after updating newest version Link to comment Share on other sites More sharing options...
aumatco Posted January 1, 2011 Share Posted January 1, 2011 take images.inc.php older version 1.3.3PROBLEM SOLVED Link to comment Share on other sites More sharing options...
Igor Schlumberger Posted January 1, 2011 Share Posted January 1, 2011 @Aumatco,I will post here a link to a new version of images.inc.php when it will works on littlez configuration. You will tell me if the new version works. Link to comment Share on other sites More sharing options...
aumatco Posted January 1, 2011 Share Posted January 1, 2011 the newest version images.inc.php 1.3.5 don t work. i take an older one 1.3.3 from prestashops.nl and it worked like charm.i report a bug on this Link to comment Share on other sites More sharing options...
Zingo Posted January 3, 2011 Share Posted January 3, 2011 Still no news?! Link to comment Share on other sites More sharing options...
littlez Posted January 3, 2011 Share Posted January 3, 2011 Igor Schlumberger Is Working on it...... Link to comment Share on other sites More sharing options...
rocky Posted January 4, 2011 Share Posted January 4, 2011 Bruno has posted updated code on the bug report here. Please try it and let us know whether it works for you. 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