srwiez/php-svg-ps-converter

SVG (Portable and Secure) converter for BIMI compliance

v1.2.1 2024-10-17 08:25 UTC

This package is auto-updated.

Last update: 2024-10-17 08:41:31 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require GitHub Workflow Status (with event)

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.