• Resolved salehm40

    (@salehm40)


    Hello,
    I want to use a base64 encoded SVG image as the brand image in the Safelayout Cute Preloader.
    To do this, I first encoded the SVG image to base64 and then added “data:image/svg;base64,” to the beginning of it, like this:

    data:image/svg;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSI0NSIgdmlld2JveD0iMCAwIDQ1IDE1Ij4NCiAgPHJlY3QgeT0iMCIgaGVpZ2h0PSIxNSIgd2lkdGg9IjQ1IiBzdHJva2U9IiMxNzkiIHJ4PSIxIiBmaWxsPSIjMmFjIi8+DQogIDx0ZXh0IHg9IjQiIHk9IjEyIiBmb250LWZhbWlseT0iY291cmllciIgc3Ryb2tlPSJ3aGl0ZSIgZm9udC1zaXplPSIxNiI+VGVzdDwvdGV4dD4NCjwvc3ZnPg0K

    But I got an Image loading error!

Viewing 1 replies (of 1 total)
  • Plugin Author safelayout

    (@safelayout)

    Hi @salehm40,
    Thanks for reaching out to us!

    You added the wrong MIME type. You should replace “svg” with “svg+xml”, like this:

    data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTUiIHdpZHRoPSI0NSIgdmlld2JveD0iMCAwIDQ1IDE1Ij4NCiAgPHJlY3QgeT0iMCIgaGVpZ2h0PSIxNSIgd2lkdGg9IjQ1IiBzdHJva2U9IiMxNzkiIHJ4PSIxIiBmaWxsPSIjMmFjIi8+DQogIDx0ZXh0IHg9IjQiIHk9IjEyIiBmb250LWZhbWlseT0iY291cmllciIgc3Ryb2tlPSJ3aGl0ZSIgZm9udC1zaXplPSIxNiI+VGVzdDwvdGV4dD4NCjwvc3ZnPg0K

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Error in base64 encoded SVG image’ is closed to new replies.