Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
SRWieZ committed Oct 31, 2023
1 parent 1099ba3 commit 338ee63
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ composer require srwiez/php-svg-ps-converter

## Usage

Example of usage:

Example of identifying issues and converting the SVG:
```php
// Identify issues and convert 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
```php

// 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 contains is not square
$svg_converter = new SVGTinyPS(getSVGContent($svg_fixed));
$issues_cannot_be_fixed = $svg_converter->identifyIssues();
```
Expand Down

0 comments on commit 338ee63

Please sign in to comment.