PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
  Classes of rajani  >  Resize image  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: resizing of images
Class: Resize image
Resize GIF, JPEG and PNG images
Author: By
Last change:
Date: 5 years ago
Size: 355 bytes
 

Contents

Class file image Download
<?php

   
// *** Include the class
   
include("resize-class.php");

   
// *** 1) Initialise / load image
   
$resizeObj = new resize('sample.jpg');

   
// *** 2) Resize image (options: exact, portrait, landscape, auto, crop)
   
$resizeObj -> resizeImage(960, 450, 'crop');

   
// *** 3) Save image
   
$resizeObj -> saveImage('sample-resized.jpg', 100);

?>