2017 © Pedro Peláez
 

library image

PHP image class

image

delboy1978uk/image

PHP image class

  • Tuesday, January 30, 2018
  • by delboy1978uk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 670 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 6 Versions
  • 21 % Grown

The README.md

image

Latest Stable Version Total Downloads Latest Unstable Version License
build status Code 
Coverage Scrutinizer Code Quality
A PHP image class utilising the gd library, (*1)

Installing

composer require delboy1978uk/image, (*2)

Usage

Instantiation

You can pass a path name into the constructor, or you can use the load() method. Accepts png, jpg, gif, and webp images., (*3)

<?php

use Del\Image;

$image = new Image('/path/to/my.jpg');

// Or...
$image = new Image();
$image->load('/path/to/my.png');

Available Methods

<?php

use Del\Image;

$image = new Image('/path/to/my.jpg');
$image->crop($width, $height, 'center'); // Crops the image, also accepts left or right as 3rd arg
$image->destroy(); // remove loaded image in the class. Frees up any memory
$image->getHeader(); // returns image/jpeg or equivalent
$image->getHeight(); // returns height in pixels
$image->getWidth(); // returns width in pixels
$image->output(); // output to browser
$image->output(true); // passing true returns raw image data string
$image->outputBase64Src(); // for use here <img src="HERE" />
$image->resize($width, $height); // resize to the given dimensions
$image->resizeAndCrop($width, $height); // resize to the given dimensions, cropping top/bottom or sides
$image->save(); // Save the image
$image->save('/path/to/save.jpg', $permissions, $compression); // Save as a different image
$image->scale(50); // Scale image to a percentage

The Versions

30/01 2018

dev-master

9999999-dev

PHP image class

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

28/09 2017

v2.0.0

2.0.0.0

PHP image class

  Sources   Download

MIT

The Requires

 

by Derek McLean

28/09 2017

v1.2.0

1.2.0.0

PHP image class

  Sources   Download

MIT

The Requires

 

by Derek McLean

28/09 2017

v1.1.0

1.1.0.0

PHP image class

  Sources   Download

MIT

The Requires

 

by Derek McLean

19/07 2015

v1.0.1

1.0.1.0

PHP image class

  Sources   Download

MIT

by Derek McLean

17/07 2015

v1.0.0

1.0.0.0

PHP image class

  Sources   Download

MIT

by Derek McLean