0

I manually uploaded svg to media subfolder (pub/media/catalog/product/placeholder/default) and edited in table core_config_data path catalog/placeholder/image_placeholder to reflect file name change (i.e. default/logo.svg)
All is fine with exception of changed mime type as svg is served as html. I did similar change of theme's logo image and file is served as svg.
How to change/force mime type for product placeholder images?

1 Answer 1

0

Solution was to exclude svg from nginx image_filter module (in default nginx magento config):

#  location ~* ^/media/catalog/.* {
   location ~* ^/media/catalog/.+(?<!\.svg)$ {

       set $width "-";
       set $height "-";
       if ($arg_width != '') {
           set $width $arg_width;
       }
       if ($arg_height != '') {
           set $height $arg_height;
       }
       image_filter resize $width $height;
       image_filter_jpeg_quality 90;
   }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.