-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# imgman | ||
|
||
This library uses GD and EXIF (optional) PHP extensions so make sure you have them | ||
|
||
Install: | ||
``` | ||
composer require leongrdic/imgman | ||
``` | ||
|
||
|
||
Example usages: | ||
``` | ||
use Le\ImgMan\{ImgMan, ImageFormat}; | ||
$img = new ImgMan() | ||
->fromDataUrl($dataUrlFromJS) | ||
->cacheExif() | ||
->downscale(2048) | ||
->rotateFromExif() | ||
->output(ImageFormat::jpeg, 75) | ||
->toString(); | ||
``` | ||
|
||
``` | ||
use Le\ImgMan\{ImgMan, ImageFormat}; | ||
new ImgMan() | ||
->fromFile('example.png') | ||
->downscale(1024) | ||
->output(ImageFormat::webp, 80) | ||
->toFile('example.webp'); | ||
``` | ||
|
||
``` | ||
use Le\ImgMan\{ImgMan, ImageFormat}; | ||
new ImgMan() | ||
->fromString($rawImageBytes) | ||
->output(ImageFormat::png, 80) | ||
->toFile('example.png'); | ||
``` | ||
|
||
# Notice | ||
|
||
This library hasn't yet been fully tested and is to be used at your own responsibility. | ||
Any feedback and improvement suggestions are appreciated! |