KostasX Posted December 30, 2011 Share Posted December 30, 2011 With a minor change you can upload png or gif images with transparency directly from the Preferences->Appearance. All you have to do is edit adminFolder/tabs/AdminPreferences.php and find the lines for image save process. I will show you the code for PS_LOGO and you can do the same for PS_LOGO_MAIL and PS_LOGO_INVOICE. This was tested in 1.4.6.2 and don't know if it works for other versions, but it should work for most 1.4 versions. So, in line 259 you have to change this code: if (isset($_FILES['PS_LOGO']['tmp_name']) AND $_FILES['PS_LOGO']['tmp_name']) { if ($error = checkImage($_FILES['PS_LOGO'], 300000)) $this->_errors[] = $error; if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmpName)) return false; elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo.jpg')) $this->_errors[] = 'an error occurred during logo copy'; unlink($tmpName); } into this: if (isset($_FILES['PS_LOGO']['tmp_name']) AND $_FILES['PS_LOGO']['tmp_name']) { $tmp = explode('/',$_FILES['PS_LOGO']['type']); // Add these two lines to get $extension = count($tmp) == 2 ? $tmp[1] : 'jpg'; // the image type if ($error = checkImage($_FILES['PS_LOGO'], 300000)) $this->_errors[] = $error; if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['PS_LOGO']['tmp_name'], $tmpName)) return false; elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo.jpg',NULL,NULL,$extension)) //and pass it to imageResize to create the file accordingly $this->_errors[] = 'an error occurred during logo copy'; unlink($tmpName); } Actually the changes are these 2 lines you have to add in the beginning of the if statement $tmp = explode('/',$_FILES['PS_LOGO']['type']); $extension = count($tmp) == 2 ? $tmp[1] : 'jpg'; and the alteration of this line elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo.jpg')) to this elseif (!@imageResize($tmpName, _PS_IMG_DIR_.'logo.jpg',NULL,NULL,$extension)) You can change also the next 2 if statements for PS_LOGO_MAIL and PS_LOGO_INVOICE exactly the same way. I hope you 'll find it helpfull. 1 Link to comment Share on other sites More sharing options...
KostasX Posted January 14, 2012 Author Share Posted January 14, 2012 I feel really dumb for this post. There is an option for uploading PNG images in Preferences -> Images -> Use PNG only if the base image is in PNG format. I reinvented the wheel !!! Good for ME 3 Link to comment Share on other sites More sharing options...
richmondthuku Posted February 24, 2012 Share Posted February 24, 2012 @Kostas I feel really dumb for this post. There is an option for uploading PNG images in Preferences -> Images -> Use PNG only if the base image is in PNG format. I reinvented the wheel !!! Good for ME You still were of such great help. I followed everything from your first post all the way down just to find the simpler route on your last post, i'l start reading through before practicing anything now http://www.jambo254.com/ Link to comment Share on other sites More sharing options...
panzeleny Posted March 26, 2012 Share Posted March 26, 2012 I am sorry, but this also doesn´t work. When I change option to "use PNG..." nothing happens - pngs are still not transparent.... v.1.4.7 Link to comment Share on other sites More sharing options...
KostasX Posted March 26, 2012 Author Share Posted March 26, 2012 I am sorry, but this also doesn´t work. When I change option to "use PNG..." nothing happens - pngs are still not transparent.... v.1.4.7 Do you upload PNG images with transparency? This work only if the images you uploaded have already transparent background. Link to comment Share on other sites More sharing options...
Arkadia Posted July 11, 2012 Share Posted July 11, 2012 (edited) I feel really dumb for this post. There is an option for uploading PNG images in Preferences -> Images -> Use PNG only if the base image is in PNG format. I reinvented the wheel !!! Good for ME lol. You may have reinvented the wheel but thanks a lot for posting both those solutions! Was helpful. Edited July 11, 2012 by Arkadia (see edit history) Link to comment Share on other sites More sharing options...
Arkadia Posted July 11, 2012 Share Posted July 11, 2012 I am sorry, but this also doesn´t work. When I change option to "use PNG..." nothing happens - pngs are still not transparent.... v.1.4.7 Make sure you re-upload the images after changing the settings... Link to comment Share on other sites More sharing options...
PaoloFrunzio Posted April 9, 2016 Share Posted April 9, 2016 Hi, sigh.. still looking for "animated-gif-as-logo" for my: www.moratospain.es Prestashop 1.6.1.4 TIll now I did: - I uploaded via FileZilla: moratospain.es/img/fashion-barcelona-logo-1460114402.gif (img folder): the animated gif is only 48Kb and works fine. - I changed the header.tpl (themes folder) from: src="{$logo_url}" to: src="/{$img_ps_dir}fashion-barcelona-logo-1460114402.gif?" from: <img class="logo img-responsive" src="{$logo_url}" alt="{$shop_name|escape:'html':'UTF-8'}"{if isset($logo_image_width) && $logo_image_width} width="{$logo_image_width}"{/if}{if isset($logo_image_height) && $logo_image_height} height="{$logo_image_height}"{/if}/> to: <img class="logo img-responsive" src="/{$img_ps_dir}fashion-barcelona-logo-1460114402.gif?" alt="{$shop_name|escape:'html':'UTF-8'}"{if isset($logo_image_width) && $logo_image_width} width="{$logo_image_width}"{/if}{if isset($logo_image_height) && $logo_image_height} height="{$logo_image_height}"{/if}/> ..but it doesn't WORK !! What did I miss ?!! Paolo Link to comment Share on other sites More sharing options...
bao nam Posted June 15, 2016 Share Posted June 15, 2016 Hi. PaoloFrunzio i think, "Gif image Module" is what you are looking for. http://addons.prestashop.com/en/23355-gif-image.html What this module does for you: Upload Gif image file for product. Upload Gif image file for logo. You can select to enable Gif image for an image size. Support multi store. 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