sv-images

Image manipulation library with an HTTP based API.

MIT License

Downloads
92
Stars
7
Committers
1

svycka/sv-images

Image manipulation library written in PHP, similar to cloud image processing services like Imgix and Cloudinary. This module simplifies image manipulation for Zend Framework 2

Install

Via Composer

$ composer require svycka/sv-images

Basic Usage

  • Register SvImages as module in config/application.config.php
  • Create filesystem factory, exmaple:
class ImageFilesystemFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $flysystem = new \League\Flysystem\Filesystem(new Local(__DIR__.'/path/to/files'));
        $adapter = new \SvImages\Filesystem\Adapter\FlySystemAdapter($flysystem);
        return new \SvImages\Filesystem\Filesystem($adapter);
    }
}
  • Create cache storage, for best performance should point to public directory, so once cache is generated PHP will not be hit at all, example:
class ImageCacheStorageFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $flysystem = new \League\Flysystem\Filesystem(new Local(__DIR__.'/path/to/public'));
        return new \SvImages\Cache\FlySystemStorage($flysystem);
    }
}

Change log

Please see CHANGELOG for more information what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

Package Rankings
Top 23.41% on Packagist.org
Badges
Extracted from project README
Build Status Coverage Status Quality Score Latest Version on Packagist Software License Total Downloads