imgresizer This widget use URL-based API of imgurl.com

  1. Requirements
  2. Painful things
  3. Resize
  4. Scale
  5. Width
  6. Height
  7. Fit
  8. Thumbnail
  9. Square
  10. Crop
  11. Watermark
  12. Black & White
  13. Invert
  14. Blur
  15. Sharpen
  16. Convert

This widget uses URL-based API for process images. There are many commands:

  • Resize
  • Scale
  • Width
  • Height
  • Fit
  • Thumbnail
  • Square
  • Rotate
  • Crop
  • Watermark
  • Black & White
  • Invert
  • Blur
  • Sharpen
  • Convert

Requirements

Yii 1.1 or above (tested on 1.1.8)

Painful things

The webservice urlimg.com is completely free to use up to the first 50 MB of processed images stored.

Resize

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'resize',
    'width' => '66',
    'height' => '66'
)); ?>

Scale

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'scale',
    'percent' => '66',
)); ?>

Width

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'width',
    'size' => '66',
)); ?>

Height

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'hright',
    'size' => '66',
)); ?>

Fit

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'fit',
    'width' => '66',
    'height' => '66',
)); ?>

Thumbnail

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'thumbnail',
    'size' => '66',
)); ?>

Square

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'square',
    'size' => '66',
)); ?>

Crop

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'crop',
    'cornerx' => '66',
    'cornery' => '66',
    'width' => '66',
    'height' => '66'
)); ?>

Watermark

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'wm',
    'text' => 'Some text'
)); ?>

Black & White

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'bw'
)); ?>

Invert

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'invert'
)); ?>

Blur

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'blur'
)); ?>

Sharpen

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'sharpen'
)); ?>

Convert

<?php $this->widget('ext.imgresizer.ImgResizer', array(
    'imageUrl' => 'http://www.yiiframework.com/files/logo/yii.png',
    'command' => 'convert',
    'format' => 'gif'
)); ?>
5 2
4 followers
1 159 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Web Service
Developed by: sensorario
Created on: Oct 4, 2011
Last updated: 13 years ago

Downloads

show all

Related Extensions