2017 © Pedro Peláez
 

library stefano-image

Image processing

image

stefano/stefano-image

Image processing

  • Monday, December 11, 2017
  • by Stefano123
  • Repository
  • 1 Watchers
  • 1 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Stefano Image

Build Status Coverage Status, (*1)

Features

  • Resize and save image
  • Add watermark
  • Supported input and output format jpg, png, gif

Dependencies

  • php GD2 extension

Instalation using Composer

  1. Run command composer require stefano/stefano-image

Usage

This is the original image, (*2)

, (*3)

  • resize and keep source image aspect ration
$maxWidth = 200;
$maxHeight = 200;
$resizer = new \StefanoImage\Image();
$resizer->sourceImage($sourceImage)
        ->resize($maxWidth, $maxHeight)
        ->save($outputDir, $name);

This is the output, (*4)

, (*5)

  • adaptive resize
$width = 200;
$height = 50;
$resizer = new \StefanoImage\Image();
$resizer->sourceImage($sourceImage)
        ->adaptiveResize($width, $height)
        ->save($outputDir, $name);

This is the output, (*6)

, (*7)

  • pad
$width = 200;
$height = 200;
$resizer = new \StefanoImage\Image();
$resizer->sourceImage($sourceImage)
        ->pad($width, $height)
        ->save($outputDir, $name);

This is the output, (*8)

, (*9)

  • pad and change background color
$width = 350;
$height = 150;
$resizer = new \StefanoImage\Image();
$resizer->sourceImage($sourceImage)
        ->pad($width, $height)
        ->backgroundColor(35, 210, 240)
        ->save($outputDir, $name);

This is the output, (*10)

, (*11)

  • add watermark
$maxWidth = 350;
$maxHeight = 150;
$maxWidthPercent = 40;
$maxHeightPercent = 40;
$opacity = 30;
$watermarkPosition = \StefanoImage\Image::WATERMARK_POSITION_TOP_RIGHT;
$resizer = new \StefanoImage\Image();
$resizer->sourceImage($sourceImage)
        ->resize($maxWidth, $maxHeight)
        ->addWatermark($watermark, $maxWidthPercent, $maxHeightPercent, $opacity, $watermarkPosition)
        ->save($outputDir, $name);

This is the output, (*12)

, (*13)

  • change output format
$resizer->outputFormat(\StefanoImage\Image::OUTPUT_FORMAT_PNG);
  • change output quality
$resizer->quality(15);

The Versions

11/12 2017

dev-master

9999999-dev https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

11/12 2017

0.2.1

0.2.1.0 https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

11/12 2017

dev-develop

dev-develop https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

21/09 2017

0.2.0

0.2.0.0 https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.0.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

31/03 2017

0.1.1

0.1.1.0 https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

19/01 2014

0.1.0

0.1.0.0 https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Štefan Bartko

image resize watermark pad adaptive resize

15/06 2013

0.0.1

0.0.1.0 https://github.com/bartko-s/stefano-image

Image processing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

The Development Requires

by Štefan Bartko

image resize