Recommend this page to a friend! |
NanoImage is a simple php image resize class. It can resize image and display it in browser or save image in a directory
Installation is super-easy via Composer:
composer require peterujah/nano-imag
$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 | > | ![]() |
> | ![]() |
> | ![]() |
> | ![]() ![]() |
|
Groups | ![]() |
Applications | ![]() |
Groups |
![]() |
Classes using PHP 5 specific features | View top rated classes |
![]() |
Colors, images, charts and picture formats | View top rated classes |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
![]() ![]() NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
![]() ![]() NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|