razor/thumbnailer

An image thumbnailer service module for Zend Framework 2

v1.0.1 2013-12-30 01:34 UTC

This package is not auto-updated.

Last update: 2024-04-08 12:24:12 UTC


README

Build Status Coverage Status Dependency Status Latest Stable Version Total Downloads Latest Unstable Version

  • An image thumbnailer service module for Zend Framework 2.
  • There is also available a form filter that internally uses the Thumbnailer service.

Install with Composer

{
 "repositories": [
       {
           "type": "vcs",
           "url": "https://github.com/kaiohken1982/Thumbnailer.git"
       }
   ],
   "require": {
       ......,
       "razor/thumbnailer" : "dev-master"
   }
}

How to use

In a controller

   	$thumbnailer = $this->getServiceLocator()->get('Thumbnailer');
   	$thumbnailer->open('\path\to\image.png');
   	$thumbnailer->resize(400);
   	$thumbnailer->save('\path\to\image_resized.png');

Run unit test

Please note you must be in the module root.

curl -s http://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit 

If you have xdebug enabled and you want to see code coverage run the command below, it'll create html files in Thumbnailer\test\data\coverage

./vendor/bin/phpunit --coverage-html data/coverage