Skip to content

Commit 360aa60

Browse files
committed
added readme
1 parent 77dba88 commit 360aa60

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# imgman
2+
3+
This library uses GD and EXIF (optional) PHP extensions so make sure you have them
4+
5+
Install:
6+
```
7+
composer require leongrdic/imgman
8+
```
9+
10+
11+
Example usages:
12+
```
13+
use Le\ImgMan\{ImgMan, ImageFormat};
14+
15+
$img = new ImgMan()
16+
->fromDataUrl($dataUrlFromJS)
17+
->cacheExif()
18+
->downscale(2048)
19+
->rotateFromExif()
20+
->output(ImageFormat::jpeg, 75)
21+
->toString();
22+
```
23+
24+
```
25+
use Le\ImgMan\{ImgMan, ImageFormat};
26+
27+
new ImgMan()
28+
->fromFile('example.png')
29+
->downscale(1024)
30+
->output(ImageFormat::webp, 80)
31+
->toFile('example.webp');
32+
```
33+
34+
```
35+
use Le\ImgMan\{ImgMan, ImageFormat};
36+
37+
new ImgMan()
38+
->fromString($rawImageBytes)
39+
->output(ImageFormat::png, 80)
40+
->toFile('example.png');
41+
```
42+
43+
# Notice
44+
45+
This library hasn't yet been fully tested and is to be used at your own responsibility.
46+
Any feedback and improvement suggestions are appreciated!

0 commit comments

Comments
 (0)