Provides a small object oriented api to generate imgix urls.
composer.phar require hschulz/imgix-php-api
<?php
require_once './vendor/autoload.php';
use \hschulz\imgix\FocalPointCrop;
use \hschulz\imgix\UriBuilder;
/* Create a new builder with your own imgix domain */
$builder = new UriBuilder('https://your-domain.imgix.net');
/* Create and configure features */
$focalPoint = new FocalPointCrop();
$focalPoint->setX(0.7);
$focalPoint->setY(0.2);
$focalPoint->setZoom(1.2);
/* Apply features to the query builder */
$builder->addQueryPart($focalPoint);
/* Create the uri to the requested image path */
$uri = $builder->getImageUri('/path/to/your/image.jpg');
echo $uri
$ https://your-domain.imgix.net/path/to/your/image.jpg?fp-x=0.7&fp-y=0.2&fp-z=1.2
# Either use the phpunit with whatever parameters you prefer
./vendor/bin/phpunit --bootstrap=./vendor/autoload.php --whitelist=./src/ --testdox ./Tests/
# Or run the composer test script which is set to the above parameters
composer.phar test
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Hauke Schulz - Author - hschulz
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details