suspectx86 Posted February 9, 2011 Share Posted February 9, 2011 Everytime I try to add a product to my catalog my image will fail to upload. And I get the following error.image format not recognized, allowed formats are: .gif, .jpg, .pngSo I started checking out what could cause the trouble, my first conclusion was something on the server is preventing the MIME types from being checked, could be PHP.INI file. Just to be sure there wasn't any restriction on uploading, I installed a simple upload script from tizag and it worked just fine...The solution is probably getting rid of the code that checks the MIME types in Prestashop (v 1.3.6). Problem is I've been looking for hours and I still can't find the code that checks the MIME types. If there's somebody out there that knows where I can locate this code within Prestashop, please response...thanks in advance.Any other solutions are welcome... (site is running on shared linux server) Link to comment Share on other sites More sharing options...
shoulders Posted February 9, 2011 Share Posted February 9, 2011 I cannot give you any syntax or examples but i do know you can set MIME types in the .htaccess fileif you search online for MIME Types and .htaccess you might find an answerAlso you might want to check for php error logs created in the admin directory (it might be elsewhere) and this could also give you some help. again do google for turn php error reporting on.the obviuos one, have you tried other picture files off your hard drive rather than just a few from the same batch. i have had jpegs in the past only photoshop would open. Link to comment Share on other sites More sharing options...
suspectx86 Posted February 10, 2011 Author Share Posted February 10, 2011 I want to delete MIME check code of prestashop. Because I have no administrative rights on the server. It's a shared webserver running linux... and I'm running prestashop 1.3.6 Link to comment Share on other sites More sharing options...
shoulders Posted February 10, 2011 Share Posted February 10, 2011 just a thought you could try my multi image uploader v2 (i totaly forgot i wrote it)http://www.prestashop.com/forums/viewthread/79361/third_party_modules/extension_multi_image_uploader_for_products_v2/ Link to comment Share on other sites More sharing options...
suspectx86 Posted February 10, 2011 Author Share Posted February 10, 2011 I already found what I was looking for, commenting out these lines in images.inc.php //if (!isPicture($file))//return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png'); But it did not solve my problem:( Link to comment Share on other sites More sharing options...
suspectx86 Posted February 10, 2011 Author Share Posted February 10, 2011 I got rid of the MIME-type error... but now I'm getting another error..an error occurred while copying imageSo it's something else that's causing the trouble. Could it be a permission problem? Link to comment Share on other sites More sharing options...
suspectx86 Posted February 10, 2011 Author Share Posted February 10, 2011 It's probably not a permission problem I changed all permissions to 777 for the /img directory and all subfolders. this includes the /tmp and /p folderNow I really don't know what's causing the trouble I tried all kinds of resolution also... so it's not resolution related either.Any clue on what else might be causing this new error? Link to comment Share on other sites More sharing options...
shoulders Posted February 11, 2011 Share Posted February 11, 2011 first of all restore your images.inc.phpdepending on your server setup the folders should be set to 755 and files to 644 (this is if you have suphp or suexec installed, most large providers like justhost and hostgator have these on), setting to 777 is a security risk and can cause stuff to stop working.an error occurred while copying imagethis indicates there is something wrong with the file format. As i mentioned before gets some images of the net, not to large, jpg, png and gif and try uploading them. then check your php error log if it does not work. Link to comment Share on other sites More sharing options...
FireHawk Posted February 13, 2011 Share Posted February 13, 2011 Hi,I am having this same problem and nothing i seem to do is solving it.Everytime i go to upload products with images the imagenever copies and i get the "Error copying image:" message after import.I have checked all permissions, actual url's and exact wording along with filetype and size.All should be perfect. i can see the image of where it is loaded on my host site if i navigate direct to it as well.I have tried saving them in a different place and still get the same error.I even went back to an older csv file to re-copy the url of a "generic picture" that uploaded fine several times a few days ago. Copied the link and popped it into a new csv file for a new product and that image now fails to upload when importing.It's driving me crazy and i do not want to add images 1 by 1 per roduct after importing 1000+ products without an image.Can anyone shed any more light on this matter please?Chris Link to comment Share on other sites More sharing options...
suspectx86 Posted February 13, 2011 Author Share Posted February 13, 2011 I came up with one more possible issue... The GD library.... If you look in the img/p/ directory you see all those images resized at different sizes. Could it be that the GD library is turned of or is not properly configered or something in that direction.Because finaly the GD library is responsible for the resize copies, so that could be the issue... Link to comment Share on other sites More sharing options...
shoulders Posted February 13, 2011 Share Posted February 13, 2011 possibly a bug in PS with 1.3.4 and 1.3.5 see herehttp://www.prestashop.com/bug_tracker/view/image_mimetype_error_on_upload/ Link to comment Share on other sites More sharing options...
bargain-box Posted February 13, 2011 Share Posted February 13, 2011 I just solved this with the help of another user. Find your images.inc.php and cut the contents and paste it to wordpad and save it for emergency. Send me your email address and I'll send you a copy of what to replace it with. Worked great for me. If I can find the link where I got the replacement code from, I'll send you that instead.Brian Link to comment Share on other sites More sharing options...
FireHawk Posted February 13, 2011 Share Posted February 13, 2011 I've tried the suggested changes in the link from shoulders above and nothing worked for me.I am using ver 1.3.6.0They all seemed to mess up categories too so i restored back to the original file now. Link to comment Share on other sites More sharing options...
Troy Posted February 13, 2011 Share Posted February 13, 2011 I am using 1.3.4 and I followed the below mentioned and it worked for me./images.inc.phpcomment this$const = defined(’FILEINFO_MIME_TYPE’) ? FILEINFO_MIME_TYPE : FILEINFO_MIME;then change$finfo = finfo_open($const);to this$finfo = finfo_open(FILEINFO_MIME_TYPE); This taken from http://www.prestashop.com/bug_tracker/view/image_mimetype_error_on_upload/ Link to comment Share on other sites More sharing options...
FireHawk Posted February 13, 2011 Share Posted February 13, 2011 Thanks Troy,Just checked my code and itis as your description.The first line is commented, and the second is already showing what you suggest to alter it too.I have noticed that when i do an import, then go look into the actual product from the category tab in BO.When i goto the images tab of the product i can see the link it is trying to use, but no such file has been made within the img/p folder. Link to comment Share on other sites More sharing options...
FireHawk Posted February 13, 2011 Share Posted February 13, 2011 OMG!Think i have just solved this. Well, at least i have just uploaded 38 products all with pictures bar one that i actually typed the url wrongly.I was comparing the first csv file that i had uploaded perfectly with no problems to the newer one i was trying so hard to get to work.I noticed that the one that wasn't working, the url to the image as just www.mydomain.........The original one i did with no problems started as the full http://www.mydomain........So i altered all the newer file to include the http:// part and uploaded perfectly!Thing is i copied the url from the old csv file to a new sheet to work on so it should have kept it the same but for some reason my excel decided to just knock off the http://After days of banging my head against a brick wall, finally i think i can actuall upload my products. YAYI hope this helps anyone else suffering too.Thanks to all who tried to help too. Much appreciated.Chris Link to comment Share on other sites More sharing options...
suspectx86 Posted February 14, 2011 Author Share Posted February 14, 2011 If of any help... I just posted my phpinfo file. And please do NOT post officialy fixed problems. I use version 1.3.6Here my phpinfo:http://lotannasshop.nl/phpinfo.phpSomehow I'm starting to think this is a prestashop related bug and not server related. But you never know.. Link to comment Share on other sites More sharing options...
tri4cer Posted February 14, 2011 Share Posted February 14, 2011 Everytime I try to add a product to my catalog my image will fail to upload. And I get the following error.image format not recognized, allowed formats are: .gif, .jpg, .pngSo I started checking out what could cause the trouble, my first conclusion was something on the server is preventing the MIME types from being checked, could be PHP.INI file. Just to be sure there wasn't any restriction on uploading, I installed a simple upload script from tizag and it worked just fine...The solution is probably getting rid of the code that checks the MIME types in Prestashop (v 1.3.6). Problem is I've been looking for hours and I still can't find the code that checks the MIME types. If there's somebody out there that knows where I can locate this code within Prestashop, please response...thanks in advance.Any other solutions are welcome... (site is running on shared linux server) Hi,I had the same problem with Prestashop 1.3.6 and has just SOLVED by asking my hosting provider to fix something in the php.ini file.If your provider cannot help to fix the problem then you may consider to switch your hosting to www.xtrawebhosting.com because Prestashop is an extremely great piece of shopping cart for your online business and I believes that you don't wanna loose it. Myprovider has responded my request with 5mins of openning a help ticket and fixed the problem straight way, so impressed with theirservices.I'm now a happy PrestaShopper Jack Link to comment Share on other sites More sharing options...
suspectx86 Posted February 14, 2011 Author Share Posted February 14, 2011 I dont think thats not an option, this site is not mine. And the client is running on budget. I just want to get this over with because im not a technical guy, i just happen to know php and a few server related things.Please send me a real solution... And not some AD for another hosting provider... 1 Link to comment Share on other sites More sharing options...
tri4cer Posted February 14, 2011 Share Posted February 14, 2011 I dont think thats not an option, this site is not mine. And the client is running on budget. I just want to get this over with because im not a technical guy, i just happen to know php and a few server related things.Please send me a real solution... And not some AD for another hosting provider... Hi suspectx86,Please don't misunderstood as I'm not advertised for anyone elses and I'm not a technical person either, therefore I'veseek help from my provider with the php.ini setting. The problem have been fixed and I just thought to share it withyou and everyone whom have the same problem. I'm sure it is definitely something to do with the php.ini file becauseI can now upload the images to my shop right after my provider did something in the php.ini file.So, hope everyone to look into the php.ini file (if you know how coding it) or otherwise ask your provider to do thesetting for you...cheers!!Jack Link to comment Share on other sites More sharing options...
suspectx86 Posted February 16, 2011 Author Share Posted February 16, 2011 I downloaded the php.ini file from here and put in my www folder and now I get a 500 Internal Server Error.When I go to my admin folder the image uploader still gives me the same error an error occurred while copying image, so I just deleted it.Nothing Solved and I'm starting to get frustratedPS: Don't post anything about another hosting provider... Because it's not possible... and you will just piss me off. Link to comment Share on other sites More sharing options...
bargain-box Posted April 27, 2011 Share Posted April 27, 2011 Try replacing your existing images.inc.php with the attached one. Let me know how you get on.Brian IMAGES.INC.PHP FROM PRESTASHOP ORIGINAL INSTALLATION.txt Link to comment Share on other sites More sharing options...
rlwelch4646 Posted April 28, 2011 Share Posted April 28, 2011 Try replacing your existing images.inc.php with the attached one. Let me know how you get on.Brian I'm trying to figure out a similar problem I'm having but with the latest version of PS. Will this attachment work? Link to comment Share on other sites More sharing options...
bargain-box Posted April 28, 2011 Share Posted April 28, 2011 Hi, well, it worked for me. I went on my hosts page and into my web, found the images.inc.php, backed it up just in case, replaced it with the one I suggested and hey presto, my photos went up without any problem. If it doesn't work for you, just put the old one back until someone comes up with something better.Good luckBrian Link to comment Share on other sites More sharing options...
rlwelch4646 Posted April 28, 2011 Share Posted April 28, 2011 Nope didn't work for me. Here's to hoping that it works for others!This is so frustrating!I know I'll get over this hurdle eventually, I'm just hoping it's the first and only issue I'll encounter... blind optimism? Link to comment Share on other sites More sharing options...
ianran Posted June 3, 2011 Share Posted June 3, 2011 Any solution to this issue yet?? tried replacing images.inc.php but still the same issue.. Link to comment Share on other sites More sharing options...
bargain-box Posted June 3, 2011 Share Posted June 3, 2011 Any solution to this issue yet?? tried replacing images.inc.php but still the same issue.. That worked for me. I presume you're checked the size of the images you're trying to upload? I think the maximum size is 2000kb but the smaller the better. I can't think of anything else. On this site somewhere you'll find a link for the new images.php file that is to replace the one that comes with the program. Make sure you have the replacement file and are not uploading an old one. Afraid that's all the suggestions I have other than to suggest that it's really a difficult program to get your head around with many bugs in it, and I mean MANY.Good luck.Brian Link to comment Share on other sites More sharing options...
bargain-box Posted June 3, 2011 Share Posted June 3, 2011 I downloaded the php.ini file from here and put in my www folder and now I get a 500 Internal Server Error.When I go to my admin folder the image uploader still gives me the same error an error occurred while copying image, so I just deleted it.Nothing Solved and I'm starting to get frustratedIf you get 500 INTERNAL SERVER ERROR, try switching you "in private browsing" on before you access your admin page.Let me know if it works for you.BrianPS: Don't post anything about another hosting provider... Because it's not possible... and you will just piss me off. Link to comment Share on other sites More sharing options...
bargain-box Posted June 3, 2011 Share Posted June 3, 2011 Nope didn't work for me. Here's to hoping that it works for others!This is so frustrating!I know I'll get over this hurdle eventually, I'm just hoping it's the first and only issue I'll encounter... blind optimism? I'm afraid this is going to be the first of many, many hurdles you'll find within PS. A good freebie but the software has it's problems, and not much by way of free support.Brian Link to comment Share on other sites More sharing options...
ianran Posted June 3, 2011 Share Posted June 3, 2011 Pictures are already resized to just 80kb max, it worked yesterday but today it's just not uploading...looking for other forums but can't find any...now im stuck tsk tsk Link to comment Share on other sites More sharing options...
zoehuang07 Posted June 14, 2011 Share Posted June 14, 2011 OMG!Think i have just solved this. Well, at least i have just uploaded 38 products all with pictures bar one that i actually typed the url wrongly.I was comparing the first csv file that i had uploaded perfectly with no problems to the newer one i was trying so hard to get to work.I noticed that the one that wasn't working, the url to the image as just www.mydomain.........The original one i did with no problems started as the full http://www.mydomain........So i altered all the newer file to include the http:// part and uploaded perfectly!Thing is i copied the url from the old csv file to a new sheet to work on so it should have kept it the same but for some reason my excel decided to just knock off the http://After days of banging my head against a brick wall, finally i think i can actuall upload my products. YAYI hope this helps anyone else suffering too.Thanks to all who tried to help too. Much appreciated.Chris my version is 1.4.1 and path started as the full http://www.mydomain.(with http://).......not www.mydomain (no http://).........so still mad at this "an error ccurred while copying image"still waiting replies...Zoe Link to comment Share on other sites More sharing options...
vietnam Posted September 6, 2011 Share Posted September 6, 2011 I cannot get it to work to upload a zip file. using 1.4.2.5 Link to comment Share on other sites More sharing options...
MellowD Posted May 31, 2012 Share Posted May 31, 2012 i have the same problem "image format not recognized, allowed formats are: .gif, .jpg, .png" with Prestashop 1.4.7. Link to comment Share on other sites More sharing options...
MellowD Posted May 31, 2012 Share Posted May 31, 2012 problem solved: http://www.prestashop.com/forums/index.php?/topic/28989-solved-1-error-1-image-format-not-recognized-allowed-formats-are-gif-jpg-png/page__view__findpost__p__323968 :-) 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