ccollins Posted March 23, 2012 Share Posted March 23, 2012 Search the web & forum for a solution to the following error ... FPDF error: Not a JPEG file: /mysite/img/logo.jpg I changed the .jpg file that was there to .jpeg and that did not work, same error. I even tried to rename my logo.png to logo.jpeg and that generate the "alpha channel" version of the error. Based on forum threads I expected that would happen. Any suggestion as what to try next. I did verify the jpeg files are really jpeg generated by PhotoShop. Prestashop version 1.4.7.0 Link to comment Share on other sites More sharing options...
Guest Posted March 24, 2012 Share Posted March 24, 2012 I’m not sure if this will help. The problem I had is I set my logo to a png, and left that as the default for all in Preferences > Appearance The problem with that is there is a bug in the PDF generator that will only take a jpg file from Invoice Logo. I could have png in all the others but Invoice logo had to be jpg. Link to comment Share on other sites More sharing options...
ccollins Posted March 24, 2012 Author Share Posted March 24, 2012 I fixed the problem but I don't know why it is a problem. I simply reloaded the logo.jpg file into Gimp and saved it out again. The image now loads as part of the invoice. There must have been something in the jpg header that was confusing PDF generator. Link to comment Share on other sites More sharing options...
tivicrdotcom Posted April 9, 2012 Share Posted April 9, 2012 Re-uploading a .jpeg logo does solve the issue but there's got to be a way to be able to use PNG images because the invoice picture when used as .jpeg looks distorted (stretched). Anyone know what file to tweak? Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2012 Share Posted April 10, 2012 I have not tested this, but according to this post, you can make the size change in directory - classes - file pdf.php http://www.prestashop.com/forums/topic/128228-change-pdf-invoice-image-logo-size/ In my version 1.4.7.0 on line 156, if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg')) { if ($this->_isPngFile(_PS_IMG_DIR_.'/logo_invoice.jpg')) $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15, 'PNG'); else $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15); } elseif (file_exists(_PS_IMG_DIR_.'/logo.jpg')) { if ($this->_isPngFile(_PS_IMG_DIR_.'/logo.jpg')) $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15, 'PNG'); else $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15); } This code doesn’t look right to me, if ($this->_isPngFile(_PS_IMG_DIR_.'/logo_invoice.jpg')) Shouldn’t that be .png and not .jpg? Anyway, hope this helps you. Link to comment Share on other sites More sharing options...
tivicrdotcom Posted April 10, 2012 Share Posted April 10, 2012 Bdalton thanks for the reply and yout time. It does make a lot of sense, where exaclty is this pdf.php file located at? Is it under a module? I am running on 1.4.6.2. Thanks again. Greetings from Costa Rica! Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2012 Share Posted April 10, 2012 I'm using 1.4.7.0 in that version it is in the Classes directory and the file is called pdf.php. Link to comment Share on other sites More sharing options...
tivicrdotcom Posted April 10, 2012 Share Posted April 10, 2012 Thanks, found it and replaced jpeg for png yet I get back the following message: FPDF error: Alpha channel not supported: /home/content/13/8897513/html/tienda/img//logo.png So it does indeed make the change and displays it as .png but with that warning. I thought the two backslashes [//] before logo.png were screwing things up so I changed them on the code and now it displays: FPDF error: Alpha channel not supported: /home/content/13/8897513/html/tienda/img/logo.png So I have no clue as what to do next! Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2012 Share Posted April 10, 2012 Well, I guess you need to use the jpg, but experiment with changing the last two numbers and see if you can stop your logo from stretching. Link to comment Share on other sites More sharing options...
tivicrdotcom Posted April 10, 2012 Share Posted April 10, 2012 Yeah Thanks bdalton, I guess going back to the jpg and resizing done on the script will work. Thanks and God Bless! 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