PHP Classes

ImageX: Validate and resize uploaded image files

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

Author

Mehedi Hasan Nahid


Contributor

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: 23 packages by
Country: Bangladesh Bangladesh
Age: 32
All time rank: 81912 in Bangladesh Bangladesh
Week rank: 22 Up2 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 6x

Winner: 2x

Details

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  
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  /  src  
File Role Description
Files folder imageNahidz (1 directory)

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

  Files folder image Files  /  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  /  src  /  Nahidz  /  Imagex  /  Facades  
File Role Description
  Plain text file Imagex.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:113
This week:0
All time:9,490
This week:189Up