PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 74%Total: 538 All time: 5,598 This week: 66Up
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: 8991 in Morocco Morocco
Week rank: 193 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 (6)  
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 (6)  /  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

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:538
This week:0
All time:5,598
This week:66Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:74%StarStarStarStar
Rank:106