2017 © Pedro Peláez
 

library crop

PHP Component to resize images from a configuration file

image

femtopixel/crop

PHP Component to resize images from a configuration file

  • Monday, April 2, 2018
  • by jaymoulin
  • Repository
  • 1 Watchers
  • 1 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

[!CAUTION] As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work., (*1)

[!NOTE], (*2)

logo, (*3)

Crop

Latest Stable Version Minimum PHP Version License PayPal donation Buy me a coffee Buy me a coffee, (*4)

This component will resize images following configuration rules. allows only defined format, (*5)

Installation

composer require femtopixel/crop

Usage

<?php
$formats = array(
    'mini' => array(
        'width' => 100,
        'height' => 100,
        'full' => 'cropped',
    ),
);
$image = new \FemtoPixel\Crop\Crop('/path/to/file.png', 'mini');
$image->setFormatsFromArray($formats)->render();

You can define as many format that you want!, (*6)

  • First parameter is path to your file to display
  • Second (optional) is the format you want to display in (default : 'original' (no modification))
  • Third (optional) is path to default image displayed if path in first parameter doesn't exist. This file will be displayed in requested format. (default : 'src/missing.png')

Configuration

Each format given in method setFormatsFromArray must define width, height and optional full index., (*7)

full can be configured to 4 values depending on attended rendering :, (*8)

  • none : No cropping, no resize. Will render image with original file dimensions.
  • cropped : Crop the rendered image to be exactly dimensions defined in configuration.
  • height : Resize the image without distortion to have height to value defined in configuration.
  • width : Resize the image without distortion to have width to value defined in configuration.

The Versions

02/04 2018

dev-master

9999999-dev

PHP Component to resize images from a configuration file

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

26/06 2017
14/04 2017
29/03 2017
29/03 2017
10/11 2016
24/06 2016

0.1.5

0.1.5.0

PHP Component to resize images from a configuration file

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0
  • ext-gd ^0.0.0 || ^7.0

 

The Development Requires

24/06 2016

0.1.4

0.1.4.0

PHP Component to resize images from a configuration file

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0
  • ext-gd ^0.0.0 || ^7.0

 

The Development Requires

16/06 2016

0.1.2

0.1.2.0

PHP Component to resize images from a configuration file

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0
  • ext-gd ^0.0.0 || ^7.0

 

The Development Requires

16/06 2016

0.1.1

0.1.1.0

PHP Component to resize images from a configuration file

  Sources   Download

MIT

The Requires

  • php ^5.3 || ^7.0
  • ext-gd ^0.0.0

 

The Development Requires

14/06 2016