srwiez / php-svg-ps-converter
SVG (Portable and Secure) converter for BIMI compliance
Fund package maintenance!
SRWieZ
Requires
- php: ^8.2
- ext-dom: *
Requires (Dev)
- laravel/pint: ^1.13
- pestphp/pest: ^2.0
- symfony/var-dumper: ^6.3
README
SVG (Portable and Secure) converter for BIMI compliance.
Read more from bimi group and the RFC
๐งช If you just want to convert your SVG in a nice ui, you can use the online version of the converter!
You can also checkout the command line version of this project.
๐ Installation
composer require srwiez/php-svg-ps-converter
๐ Usage
Example of identifying issues and converting the SVG:
$svg_converter = new SVGTinyPS(getSVGContent($svg_content)); $issues = $svg_converter->identifyIssues(); $svg_fixed= $svg_converter->convert();
Some issues cannot be fixed automatically, you can get them by rerunning identifyIssues()
Namely, the issues that cannot be fixed are:
- The SVG contains an image
- The SVG is not square
- The SVG size > 32kb
$svg_converter = new SVGTinyPS(getSVGContent($svg_fixed)); $issues_cannot_be_fixed = $svg_converter->identifyIssues();
๐ฅ Credits
SVGTinyPS was created by Eser DENIZ.
Inspired by the official scripts of authindicators/svg-ps-converters
Thanks to gilbarbara/logos for the logos used in the tests.
๐ License
SVGTinyPS PHP is licensed under the MIT License. See LICENSE for more information.