2017 © Pedro Peláez
 

library thumbnail

Generating image thumbnails

image

kollarovic/thumbnail

Generating image thumbnails

  • Tuesday, August 30, 2016
  • by Kollarovic
  • Repository
  • 3 Watchers
  • 8 Stars
  • 11,559 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 11 Forks
  • 8 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

Usage

{var $image='images/image.jpg'}

<img src="{$image|thumbnail: 150, 150}" />

Installation

composer.json, (*1)

composer require kollarovic/thumbnail

config.neon, (*2)



extensions: thumbnail: Kollarovic\Thumbnail\DI\Extension

Configuration

config.neon, (*3)


thumbnail: thumbPathMask: 'images/thumbs/{filename}-{width}x{height}.{extension}' placeholder: 'http://dummyimage.com/{width}x{height}/efefef/f00&text=Image+not+found'

MD5 thumbnail saving

{md5} param in thumbPathMask takes file path and file name, converts it to md5 hash and then saves it in nested directories to avoid having millions of files in one folder. For example let's say md5 hash of my src location somedir/project/www/images/users/1/profile.jpg is e728fdeab7e2edda33f36fbf7a2b7c82 so using this thumbPathMask:, (*4)


thumbPathMask: 'images/thumbs/{md5}/{width}x{height}-{crop}.{extension}'

it gets stored in images/thumbs/e/7/2/e728fdeab7e2edda33f36fbf7a2b7c82/{width}x{height}-{crop}.jpg, (*5)

The Versions

30/08 2016

dev-master

9999999-dev

Generating image thumbnails

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mario Kollarovic

image nette latte thumbnail

02/03 2015

1.0.0

1.0.0.0

Generating image thumbnails

  Sources   Download

New BSD

The Requires

 

The Development Requires

by Mario Kollarovic

image nette latte thumbnail

21/03 2014

dev-nette-2.1

dev-nette-2.1

Generating image thumbnails

  Sources   Download

New BSD

The Requires

 

by Mario Kollarovic

image nette latte thumbnail