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 Ondra Rafaj  >  Fuerte Image Tool  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: Fuerte Image Tool
Perform image manipulation operations
Author: By
Last change:
Date: 7 years ago
Size: 775 bytes
 

Contents

Class file image Download
<?php
// Using of resize class

require_once('images.class.php');

$new_width 100;
$new_height 100;


// new instance of class
$img = new images('image.jpg');

//create image from form
//$img = new images($_FILES['image'], 'upload');

// create image from string
//$img = new images($string, 'string');


// resizing image (constrain proportions)
$img->resize($new_width$new_height);

// resizing image (use strictly setted params)
//$img->resize($new_height, $new_height, 'strict');


//saving image
$img->save('image.jpg');

// if you want another type of image
//$img->save('image.png', 'png');
//$img->save('image.gif', 'gif');


// clearing the memory
$img->clear();


// check error output
$errors $img->getErrors();
?>