erlsvgtps

Build StatusGitHubHex.pm

Erlang SVG (Portable and Secure) converter for BIMI compliance. Project inspired by [php-svg-ps-converter][1].

Summary

The choice of a specific SVG format for BIMI is intentional. Standard SVG files can include JavaScript, posing a security threat if displayed in an email client. To prevent this risk, BIMI requires the use of SVG Tiny P/S (Portable/Secure), a streamlined version of SVG that eliminates scripting and interactive elements. This guarantees that the logo remains purely a visual identifier, free from any potentially harmful code that could jeopardize the recipient’s security.

This project allows you to identify all issues that your vector image has and also to convert the vector image into a more constrained and secure SVG format. The new format is based [SVG Tiny 1.2][2] as defined by the W3C.

Usage

Identifying issues

{ok, State} = erlsvgtps_check:from_file(<<"test/assets/waffle-icon.svg">>).

% identify issues

erlsvgtps_check:issues(S).

% or getting file metadata

erlsvgtps_check:metadata(S).

Convert file to a BIMI compliant format

{ok, _NewSvgContent} = erlsvgtps_converter:from_file(<<"test/assets/waffle-icon.svg">>).

Some issues cannot be resolved automatically. You can retrieve them by rerunning erlsvgtps_check functions. Specifically, the issues that require manual intervention include:

Other

For more functionality, check the exported functions from:

Running Tests

rebar3 eunit

[1]:https://github.com/SRWieZ/php-svg-ps-converter [2]:https://www.w3.org/TR/SVGTiny12/