easyphpthumb Wrapper on PHP Thumb 3.0 image manipulation library

  1. Documentation
  2. Change Log

This extension is simple and really easy to use wrapper on excellent PHP Thumb 3.0 library.

Resources

Documentation

Requirements
  • Yii 1.0.9 or above
Installation
  • Extract the release file under protected/extensions
Supported operations
  • resize(width, height)
  • resizePercent(percent)
  • crop(x,y,width,heigh)
Usage

Depending on frequency of usage you can use it in two ways:

  • for high usage (as component defined in config/main.php)
  • for low usage (instantiate where use)

1). Component approach:

Definition - config/main.php

..
// application components
'components'=>array(
        ..       
        'thumb'=>array(
        	'class'=>'ext.phpthumb.EasyPhpThumb',
        ),
),
..

Usage:

Yii::app()->thumb->setThumbsDirectory('/images/thumbs');

Yii::app()->thumb
->load(Yii::getPathOfAlias('webroot')."/images/".$filename)
->crop($area['x'],$area['y'],$area['width'],$area['height'])
->save($area['name'].".gif", "GIF");

2). In situ approach:

Yii::import('ext.phpthumb.EasyPhpThumb');
$thumbs = new EasyPhpThumb();
$thumbs->init();
$thumbs->setThumbsDirectory('/images/thumbs');

$thumbs
->load(Yii::getPathOfAlias('webroot')."/images/".$filename)
->crop($area['x'],$area['y'],$area['width'],$area['height'])
->save($area['name'].".gif", "GIF");

Change Log

October 25, 2009
  • Initial release (PHP Thumb 3.0).
12 0
8 followers
2 986 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: File System
Tags:
Developed by: KEo
Created on: Oct 25, 2009
Last updated: 8 years ago

Downloads

show all