Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ran Argaman  >  Image-Resizer  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Usage example.
Class: Image-Resizer
Resize an image with given dimensions
Author: By
Last change: The file...
Date: 3 years ago
Size: 967 bytes
 

Contents

Class file image Download
<?php
include ('imageResizer.php');
try{
    
$imageResizer = new ImageResizer('./pics/pic1.jpg'9090'./pics/pic1_90x90.jpg');
    echo(
'<img src="' $imageResizer -> getPath() . '"/><br /><br />');
    echo(
'<img src="' $imageResizer -> getNewPath() . '"/><br />');
    echo(
'<pre>');
    echo(
"Original dimensions:\n");
    
print_r($imageResizer -> getOriginalDimensions());
    echo(
"\nNew dimensions:\n");
    
print_r($imageResizer -> getNewDimensions());
    echo(
'</pre>');
    
    
$imageResizer = new ImageResizer('./pics/pic2.jpg'150150'./pics/pic2_150x150.jpg');
    echo(
'<img src="' $imageResizer -> getPath() . '"/><br /><br />');
    echo(
'<img src="' $imageResizer -> getNewPath() . '"/><br />');
    echo(
'<pre>');
    echo(
"Original dimensions:\n");
    
print_r($imageResizer -> getOriginalDimensions());
    echo(
"\nNew dimensions:\n");
    
print_r($imageResizer -> getNewDimensions());
    echo(
'</pre>');
}
catch(
Exception $ex){
    echo(
$ex -> getMessage());
}
?>