From 360aa609682d32583f04d46e4fce4816912b1c5d Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 26 Jan 2022 22:03:41 +0100 Subject: [PATCH] added readme --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f5780e --- /dev/null +++ b/README.md @@ -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! \ No newline at end of file