PHP Classes

ImageX: Validate and resize uploaded image files

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 116 All time: 9,555 This week: 455Up
Version License PHP version Categories
imagex 1.0.0MIT/X Consortium ...5PHP 5, Graphics, Files and Folders
Description 

Author

This class can validate and resize uploaded image files.

It can check a given uploaded image and validate it by determining if it is of one of the supported types, like JPEG, GIF and PNG.

The class can also resize the uploaded image to a given size, eventually preserving the proportions of the original image. Then it can save the processed image in a given directory.

Picture of Nahid Bin Azhar
  Performance   Level  
Name: Nahid Bin Azhar <contact>
Classes: 24 packages by
Country: United States United States
Age: 33
All time rank: 792109 in United States United States
Week rank: 187 Up27 in United States United States Up
Innovation award
Innovation award
Nominee: 6x

Winner: 2x

Documentation

imagex

Imagex is an Image handling library for Laravel 4. You can resize an image by scale, width, height and both of width and height. You can also compress image. Its too handy and easy to use.

Installation

add this in your main composer.json file require section require: "nahidz/imagex": "dev-master"

and update your composer by using "composer update" command in your terminal

Configure

Add these in your laravel app/config/app.php "providers" array

'Nahidz\Imagex\ImagexServiceProvider',

Usage

Syntax: Imagex::load($photoName, $optionsArray)->action($parameter)->save();

List of Action:

resizeToHeight($height)

resizeToWidth($width)

scale($scale)

resize($width, $height)

Options: $optionsArray must be an array. Its has four items

array( 'path'=>'where you want to save your image', 'name'=>'Which name you want to set is your image', 'compress'=>'compression value 0-100, its optional', 'permission'=>'permission code, its also optional' )

Example

Imagex::load('file', array('path'=>'public/images/', 'name'=> 'my_photo.jpg'))->resizeToWidth(480)->save();

thats it.

Thank you :)


  Files folder image Files (7)  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (7)  /  src  
File Role Description
Files folder imageNahidz (1 directory)

  Files folder image Files (7)  /  src  /  Nahidz  
File Role Description
Files folder imageImagex (2 files, 1 directory)

  Files folder image Files (7)  /  src  /  Nahidz  /  Imagex  
File Role Description
Files folder imageFacades (1 file)
  Plain text file Imagex.php Class Class source
  Plain text file ImagexServiceProvider.php Class Class source

  Files folder image Files (7)  /  src  /  Nahidz  /  Imagex  /  Facades  
File Role Description
  Plain text file Imagex.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:116
This week:0
All time:9,555
This week:455Up