2017 © Pedro Peláez
 

library thumb

PHPThumb Package for Laravel 4 (Personal version)

image

mews/thumb

PHPThumb Package for Laravel 4 (Personal version)

  • Friday, January 10, 2014
  • by mewebstudio
  • Repository
  • 2 Watchers
  • 13 Stars
  • 1,074 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 4 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHPThumb for Laravel 4 (Personal version)

A simple Laravel 4 service provider for including the PHPThumb for Laravel 4., (*1)

Installation

The PHPThumb Service Provider can be installed via Composer by requiring the mews/phpthumb package and setting the minimum-stability to dev (required for Laravel 4) in your project's composer.json., (*2)

{
    "require": {
        "laravel/framework": "4.0.*",
        "mews/thumb": "dev-master"
    },
    "minimum-stability": "dev"
}

Update your packages with composer update or install with composer install., (*3)

Usage

To use the PHPThumb Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this., (*4)

Find the providers key in app/config/app.php and register the PHPThumb Service Provider., (*5)

    'providers' => array(
        // ...
        'Mews\Thumb\ThumbServiceProvider',
    )

Find the aliases key in app/config/app.php., (*6)

    'aliases' => array(
        // ...
        'Thumb' => 'Mews\Thumb\Facades\Thumb',
    )

Example

    //[your site path]/app/routes.php

    Route::get('/media/image/{width}x{height}/{image}', function($width, $height, $image)
    {
        $file = base_path() . '/' . $image;
        // for remote file
        //$file = 'http://i.imgur.com/1YAaAVq.jpg';
        Thumb::create($file)->make('resize', array($width, $height))->show()->save(base_path() . '/', 'aaa.jpg');
        /*
            Thumb::create($file)->make('resize', array($width, $height))->make('crop', array('center', $width, $height))->show();
            Thumb::create($file)->make('resize', array($width, $height))->make('crop', array('basic', 100, 100, 300, 200))->show();
            Thumb::create($file)->make('resize', array($width, $height))->make('resize', array($width, $height))->show();
            Thumb::create($file)->make('resize', array($width, $height))->make('resize', array($width, $height, 'adaptive'))->save(base_path() . '/', 'aaa.jpg')->show();
            Thumb::create($file)->make('resize', array($width, $height))->rotate(array('degree', 180))->show();
            Thumb::create($file)->make('resize', array($width, $height))->reflection(array(40, 40, 80, true, '#a4a4a4'))->show();
            Thumb::create($file)->make('resize', array($width, $height))->save(base_path() . '/', 'aaa.jpg');
            Thumb::create($file)->make('resize', array($width, $height))->show();
        */

    });

^_^, (*7)

The Versions

10/01 2014

dev-master

9999999-dev http://github.com/mewebstudio/Thumb

PHPThumb Package for Laravel 4 (Personal version)

  Sources   Download

MIT

The Requires

 

laravel laravel 4 image thumbnail thumb l4 phpthumb