2017 © Pedro Peláez
 

library skeleton-file-picture

Tigron File utilities

image

tigron/skeleton-file-picture

Tigron File utilities

  • Monday, July 16, 2018
  • by tigron
  • Repository
  • 2 Watchers
  • 0 Stars
  • 3,770 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 10 % Grown

The README.md

skeleton-file-picture

Description

This library can resize images. The image must be of type \Skeleton\File\File, (*1)

Installation

Installation via composer:, (*2)

composer require tigron/skeleton-file-picture

Create a new table in your database:, (*3)

CREATE TABLE IF NOT EXISTS `picture` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_id` int(11) NOT NULL,
  `width` int(11) NOT NULL,
  `height` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `file_id` (`file_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

Howto

Check the \Skeleton\File README to initialize the File Store, (*4)

Initialize the picture library:, (*5)

/**
 * This function adds a picture configuration
 *
 * $params = [
 *  'width' => width in px,
 *  'height' => height in px
 *  'mode' => exact/crop/auto
 *      exact => The $height/$width will be used, ratio is ignored
 *      crop => The image is cropped in in order to fill the $height/$width frame
 *      auto => The image is resized to fit the $height/$width frame, ratio is kept
 *  'format' => image/jpeg|image/gif|image/png|image/webp|original
 */
\Skeleton\File\Picture\Config::add_configuration($params);

/**
 * Set the cache path
 * This is default set to the system TMP path
 *
 * \Skeleton\File\Picture\Config::$tmp_dir is deprecated
 */
\Skeleton\File\Picture\Config::$tmp_path = $your_very_temporary_path

Show a resized picture:, (*6)

$picture = Picture::get_by_id(1);
$picture->resize($configuration_name);

The Versions

16/07 2018

dev-master

9999999-dev

Tigron File utilities

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tigron BVBA

25/06 2018

v0.2.2

0.2.2.0

Tigron File utilities

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

06/06 2018

v0.2.1

0.2.1.0

Tigron File utilities

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

20/12 2017

v0.2.0

0.2.0.0

Tigron File utilities

  Sources   Download

MIT

The Requires

 

by Tigron BVBA

30/11 2017

v0.1.5

0.1.5.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

30/11 2017

v1.0.5

1.0.5.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

28/11 2016

v0.1.4

0.1.4.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

15/11 2016

v0.1.3

0.1.3.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

14/11 2016

v0.1.2

0.1.2.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

12/09 2016

0.1.1

0.1.1.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

27/06 2016

v0.1.0

0.1.0.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

15/01 2016

v0.0.2

0.0.2.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA

14/08 2015

v0.0.1

0.0.1.0

Tigron File utilities

  Sources   Download

MIT

The Development Requires

by Tigron BVBA