PHP Classes

PHP Image Sizer: Resize images to a given width and height

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 74%Total: 535 This week: 1All time: 5,620 This week: 560Up
Version License PHP version Categories
image-sizer 1.0.1GNU General Publi...5.3PHP 5, Graphics
Description 

Author

This class can resize images to a given width and height.

It can take a given GIF, JPEG and PNG image and resize it to a given width and height.

The class can display the image as the current script output or save to a given file.

The quality percentage of the resized image is a configurable parameter.

Picture of Mohamed Elbahja
  Performance   Level  
Name: Mohamed Elbahja is available for providing paid consulting. Contact Mohamed Elbahja .
Classes: 12 packages by
Country: Morocco Morocco
Age: 29
All time rank: 9041 in Morocco Morocco
Week rank: 106 Up1 in Morocco Morocco Equal
Innovation award
Innovation award
Nominee: 4x

Recommendations

i want to resize image class
want resize exact width and height image which i provided.

Resize image on upload
I want to modify uploaded images to a specific size

Example

<?php

require('../image_sizer.php');

$img = new image_sizer();


/**
 * setImage()
 * url : http://localhost/example1.php?img=https://upload.wikimedia.org/wikipedia/commons/c/c1/PHP_Logo.png
 *
 */
$img->setImage($_GET['img']);


/**
 * setSize
 * New image size
 * $img->setSize(Width, Height)
 */
$img->setSize(100, 60);

/**
 * show image
 *
 * $img->show(type, quality);
 * type : png, jpeg, jpg, gif
 * quality : image show quality 100 = 100%
 */
$img->show('png', 100);


Details

image_sizer

resize and save or show png, jpg and gif images using PHP


  Files folder image Files  
File Role Description
Files folder imageexamples (4 files)
Plain text file image_sizer.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file example1.php Example Example script
  Accessible without login Plain text file example2.php Example Example script
  Accessible without login Plain text file example3.php Example Example script
  Accessible without login Image file php.png Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:535
This week:1
All time:5,620
This week:560Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:74%StarStarStarStar
Rank:109