PHP Classes

Nano PHP Image Resize: Resize local or remote images

Recommend this page to a friend!

  Author Author  
Picture of Ujah Chigozie peter
Name: Ujah Chigozie peter <contact>
Classes: 17 packages by
Country: Nigeria Nigeria
Age: 31
All time rank: 232412 in Nigeria Nigeria
Week rank: 28 Up2 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 8x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This class can resize local or remote images.

It can take an image's path or URL and create a resized copy of the image in a given local directory.

The class can create resized images that preserve the ratio between the width and height of the original image.

Details

Nano Image

NanoImage is a simple php image resize class. It can resize image and display it in browser or save image in a directory

Installation

Installation is super-easy via Composer:

composer require peterujah/nano-imag

Basic Usage

$img = Peterujah\NanoBlock\NanoImage();

Initalize nano image class for use

Open and load image from by passing the directory path & file name

$img->open(__DIR__ . "/path/to/assets/image.jpg");

Or load string containing the image data.

$img->load($image_data);

Resize image with exact width and height passed, example 200x200. To resize image using aspect ratio set the thrid parameter to true

$img->resize(200, 200, false||true);

Once image manipulation is done display the output image on browser. Pass qaulity of image

$img->display($quality);

Save image to directory, first parameter specify the path, second default is null while quality is 90 by default

$img->save(__DIR__ . "/path/to/assets/new-image.jpg", NanoImage::THUMBNAIL || null, $quality);

Save image as

$img->saveAs($to, NanoImage::THUMBNAIL || null, $quality, self::JPEG)

Replace existing image with new one

$img->replace($to, $quality)

Remove temp image after editing and free momory

$img->remove()

Free memory

$img->free()

  Classes of Ujah Chigozie peter  >  Nano PHP Image Resize  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Nano PHP Image Resize
Base name: nano-image
Description: Resize local or remote images
Version: 1.0.1
PHP version: 5
License: GNU General Public License (GPL)
All time users: 110 users
All time rank: 9531
Week users: 1 user
Week rank: 171 Up
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Graphics Colors, images, charts and picture formats View top rated classes


  User ratings  
Not yet rated by the users

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Files folder imagetest (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file NanoImage.php Class Class source

  Files folder image Files  /  test  
File Role Description
  Accessible without login Plain text file upload.php Example Example script

Install with Composer Install with Composer - Download Download all files: nano-image.tar.gz nano-image.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Files folder imagetest (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file NanoImage.php Class Class source

  Files folder image Files  /  test  
File Role Description
  Accessible without login Plain text file upload.php Example Example script

Install with Composer Install with Composer - Download Download all files: nano-image.tar.gz nano-image.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.