2017 © Pedro Peláez
 

library image-cache

Image cache library

image

slick/image-cache

Image cache library

  • Wednesday, December 30, 2015
  • by fsilva
  • Repository
  • 1 Watchers
  • 0 Stars
  • 227 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Slick Image Cache

Slick Image Cache is a simple library that can profile images and cache them on the file system. You can add filters to crop, resize for example., (*1)

Features, (*2)

  • Cache image copies
  • Profiling images
  • Apply filters and transformations
  • An easy interface to add your own filters
  • Lightweight and simple!

Installation, (*3)

To use Image Cache in your project just add the following line to your project’s composer.json file:, (*4)

{
    "require": {
        "slick/ImageCache": "*",
        ...
    }
}

Then you need to run:, (*5)

$ composer update

Usage, (*6)

Create a definition array like this:, (*7)

<?php
    $config = [
        'path' => dirname(__DIR__).'/images',
            'profiles' => [
                'thumb' => [
                    'filters' => [
                        'ResizeAndTrim' => [
                            'width' => 32,
                            'height' => 32
                        ],
                    ],
                    'imageType' => Profile::TYPE_PNG,
                    'quality' => 8
                ],
                'filters' => [
                'Resize' => [
                    'width' => 680,
                    'height' => 300,
                    'proportional' => true
                ],
                'Crop' => [
                    'width' => 680,
                    'height' => 300,
                    'verticalAlign' => Crop::TOP,
                    'horizontalAlign' => Crop::CENTER
                ]
            ],
            'imageType' => Profile::TYPE_PNG,
            'quality' => 8
            ]
        ]
    ];

and initialize the image cache object:, (*8)

<?php
    $cache = new \Slick\ImageCache\ImageCache($config);

Now you can use the cache object to retrieve image profiles or to process all profiles on a provided image:, (*9)

<?php
    $image = new \Slick\ImageCache\Image("path/to/source/image.png");
    $image = $cache->get("thumb", $image);

    // process all profiles
    $cache->processImage($image);

Contribute, (*10)

Support, (*11)

If you are having issues, please let us know., (*12)

License, (*13)

The project is licensed under the MIT License (MIT), (*14)

The Versions

30/12 2015

dev-develop

dev-develop

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering

05/06 2015

dev-master

9999999-dev

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering

05/06 2015

v1.1.1

1.1.1.0

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering

03/06 2015

v1.1.0

1.1.0.0

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering

31/12 2014

v1.0.1

1.0.1.0

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering

31/12 2014

v1.0.0

1.0.0.0

Image cache library

  Sources   Download

MIT

The Requires

 

The Development Requires

cache image image processing image filtering