Skip to content
PHP client for the Abraia API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
abraia
images
tests
.coveralls.yml
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

PHP version Build Status Coverage Status

Abraia API client for PHP

PHP client for Abraia services. It is used to smartly optimize images for web.

Install

Install the PHP client:

composer install abraia/abraia

And configure your free API key as the ABRAIA_KEY environment variable:

export ABRAIA_KEY=your_api_key

Usage

Most common operations can be easily performed using the fluent API. Automatically optimize your JPEG, PNG, GIF, SVG, and WebP images without any parameterization.

$abraia = new Abraia\Abraia();

$abraia->fromFile('images/tiger.jpg')->toFile('images/optimized.jpg')

Resize and optimize an image to a maximum size preserving the aspect ratio.

$abraia->fromFile('images/tiger.jpg')->resize(500, 500, 'thumb')->toFile('images/roptim.jpg');

Resized tiger image

Tiger image resized and optimized preserving the aspect ratio

Smartly crop and optimize an image to change its aspect ratio.

$abraia->fromFile('images/tiger.jpg')->resize(500, 500)->toFile('images/resized.jpg');

Smart cropped tiger

Tiger image automatically smart cropped to show a square aspect ratio

License

This software is licensed under the MIT License. View the license.

You can’t perform that action at this time.