Is your feature request related to a problem? Please describe.
Hello, i have a lot of requesto about integrate svg logo and libraries, especially for design product
Describe alternatives you've considered
i cant considered because need preview of image.
Edited on November 24th, following https://github.com/PrestaShop/PrestaShop/issues/10600#issuecomment-728133716:
Describe the solution you'd like:
Specifications:
Hi @caygri,
Your ticket is a duplicate of #10290
So, I close it.
Thanks!
Best regards, Khouloud
Duplicate of #10290
I don't think it's a duplicate.
#10290 ticket talking about allowing .png format for favicon upload (only).
This ticket talking about allow SVG format file globally in PrestaShop, specially for picture file or thumbnail upload for a product (when we've got Symfony error: "product.svg: This file is not a valid image" in PS v1.7) or for categories or modules like _ps_banner_, _ps_imageslider_ or _blockreassurance_ ("Image format not recognized, allowed formats are: .gif, .jpg, .png").
I'm also creating a module to upload custom pictograms with the HelperForm "type => file", but SVG is still unfortunately unsupported because PrestaShop uses PHP's GD library.
This would be a great addition.
Hi @Klemart3D,
Thanks for your feedback.
Yes, I tried to import an SVG image with PS1.7.5.1, but I have an issue.
@marionf, @colinegin what do you think? it could an improvement issue to accept SVG image.
Related to #10290
Thanks!
it's impossible because prestashop use an old framwork who not supported
@PrestaShop/prestashop-core-developers is it really impossible?
SVG could enhance the quality of some merchant website but it needs to be used carefully.
Yes, You must use Imagick instead of GD.
But there should be some alternatives.
Maybe we could add support for imagick in PrestaShop, which would open new allowed formats
hh svg not supported??? why!! :'(
svg == the future of the web for images
because they use smarty and smarty non support svg
@caygri no i don't think it's smarty related!
https://stackoverflow.com/questions/54950670/prestashop-1-7-include-inline-svg-in-tpl-file
It's because of the legacy implementation, many things need to be refactor to allow the usage of new image type.
it's been almost 10 years that the svg is supported by the majority of browsers, I don't understand why the team has found it difficult to integrate a new mime type "image/svg+xml" during an image upload!
A svg file is considered exactly as a png or jpg file in its use and display!
it's been almost 10 years that the svg is supported by the majority of browsers, I don't understand why the team has found it difficult to integrate a new mime type "image/svg+xml" during an image upload!
Because this is only one of the items required to allow full SVG implementation in prestashop. Images in PrestaShop are moved, copied, resized, displayed in many manners ; and the functions required to perform all of these processings are currently being performed by PHP GD which does not support SVG.
So the work needed is a lot more, and currently are hands are full with other topics (see the in-progress work here: https://github.com/PrestaShop/PrestaShop/projects/7) but if you are motivated, would you give us a hand ? this is an opensource project, everybody can contribute 馃槃
@matks I will like to help, but the problem is the core of prestashop becuase smarty not support svg.
One year ago I will talk with Aurelien and he said is not possible and not see the urgent to change.
I have a client and i need migrate to magento for this missing part!
Smarty is a templating engine, it has nothing to do with SVG.
Because this is only one of the items required to allow full SVG implementation in prestashop. Images in PrestaShop are moved, copied, resized, displayed in many manners ; and the functions required to perform all of these processings are currently being performed by PHP GD which does not support SVG.
So the work needed is a lot more, and currently are hands are full with other topics (see the in-progress work here: https://github.com/PrestaShop/PrestaShop/projects/7) but if you are motivated, would you give us a hand ? this is an opensource project, everybody can contribute smile
Exactly the advantage is that you no longer need to create/copy/place in a specific folder ... as prestashop currently does. Just use scaleImage to have the desired size and the file size is always the same, it's also the same to change the color according to the theme...
$image = new Imagick();
$image->setBackgroundColor(new ImagickPixel('green'));
$image->readImage('./some/path/image.svg');
$image->scaleImage(20,20);
Svg are vectorial, there is no need for thumbnail anymore : no copy or resize, Imagick not needed.
By the way, if you really wants to change size of a svg for thumbailing, it's just an xml file. This can be done with few lines of php, no imagick : https://stackoverflow.com/a/48831185
@Progi1984 and I discussed this morning the possibility to add the SVG image format to PrestaShop. We decided to focus on all images upload available in the back office, except for the favicon and the email logos in the Design > Theme & Logo page.
Why? First, because favicons are a specific case using precise image formats and then because the email support for SVG images is way too limited for now.
So here are the identified steps to offer SVG support in PrestaShop:
so now is avaible?
so now is available?
I hope for the 1.7.8 version! Feel free to let us know if you'd like to create a pull request to make it available. ;-)
Most helpful comment
Because this is only one of the items required to allow full SVG implementation in prestashop. Images in PrestaShop are moved, copied, resized, displayed in many manners ; and the functions required to perform all of these processings are currently being performed by PHP GD which does not support SVG.
So the work needed is a lot more, and currently are hands are full with other topics (see the in-progress work here: https://github.com/PrestaShop/PrestaShop/projects/7) but if you are motivated, would you give us a hand ? this is an opensource project, everybody can contribute 馃槃