2017 © Pedro Peláez
 

library image-manipulation

Image manipulation, generate thumbnails

image

lewnelson/image-manipulation

Image manipulation, generate thumbnails

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

image-manipulation

A PHP class to manipulate images, (*1)

This PHP tool is designed to generate thumbnails given the path to an image. Currently it supports png, gif and jpg images., (*2)

Installation

Update composer.json, (*3)

{
    "require": {
        "lewnelson/image-manipulation": "dev-master@dev"
    }
}

Usage

To get started ensure you have loaded all classes into your script, then run the following:, (*4)

use LewNelson\ImageManipulation\ImageManipulation;

$collection = ImageManipulation::init($images);

Where $images is either a string of a path to an image or an array of paths to images. This will output either a string or array of ImageManipulation objects depending on the input. If you input an array the output will be an array with the same keys., (*5)

To generate a thumbnail you can then run the generateThumbnail() method on your ImageManipulation instances. By default without further configuration this will create a thumbnail in the same directory as the original image, prefixed by thumbnail_ with a max width of 120 and max height of 120., (*6)

The return from generating a thumbnail is an instance of the PHP class SplFileInfo., (*7)

The generateThumbnail() method accepts one parameter $options which is an array of options. This array consists of key => value pairs. The following options are available. - max_width = integer, maximum thumbnail width (default = 120) - max_height = integer, maximum thumbnail height (default = 120) - prefix = string, prefix to new thumbnail name (default = thumbnail_) - suffix = string, suffix to new thumbnail name (default = null) - jpeg_quality = integer 0-100, compression quality of new jpeg thumbnails (default = 75) - png_quality = integer 0-9, compression quality of new png thumbnails (default = 3), (*8)

In addition to setting these options you can also specify a location other than alongside the current image. This can be set via the setLocation((string)$location) method and passing an argument $location which is the new path., (*9)

The Versions

17/10 2015

dev-master

9999999-dev

Image manipulation, generate thumbnails

  Sources   Download

MIT

The Requires

  • php >=5.3.1

 

17/10 2015

dev-version_0.1

dev-version_0.1

Image manipulation, generate thumbnails

  Sources   Download

MIT

The Requires

  • php >=5.3.1

 

17/10 2015

0.1.0

0.1.0.0

Image manipulation, generate thumbnails

  Sources   Download

MIT

The Requires

  • php >=5.3.1

 

17/10 2015

dev-dev

dev-dev

Image manipulation, generate thumbnails

  Sources   Download

MIT

The Requires

  • php >=5.3.1

 

17/10 2015

0.1

0.1.0.0

Image manipulation, generate thumbnails

  Sources   Download

MIT

The Requires

  • php >=5.3.1