Login   Register  
PHP Classes
elePHPant
Icontem

File: sample02.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alessandro Coscia  >  Smart Image  >  sample02.php  >  Download  
File: sample02.php
Role: Example script
Content type: text/plain
Description: Second Example
Class: Smart Image
Resize and add watermarks to images
Author: By
Last change:
Date: 2007-10-06 03:28
Size: 935 bytes
 

Contents

Class file image Download
<?php

/**
 * Smart, easy and simple Image Manipulation
 * 
 * @author Alessandro Coscia, Milano, Italy, php_staff@yahoo.it
 * http://www.codicefacile.it/smartimage
 * @copyright LGPL
 * @version 0.8.4
 *
 */
include "SmartImage.class.php";

// Settings
$src "images/car.jpg";
$waterMark "images/smartimage.gif";
$destination "newimages/";

// Start!
$img = new SmartImage($src);
// Resize and save to file
$img->resize(400220true);
$img->saveImage($destination."new01.jpg");

// Put a Water Mark and save to file
$img->addWaterMarkImage($waterMark);
$img->saveImage($destination."new02.jpg");

// save the image with 76% resolution in Jpeg
$img->saveImage($destination."new03.jpg"76);

// output image
$img->printImage();

//convert and save it in gif and png and close the file
$img->saveImage($destination."new04.gif");
$img->saveImage($destination."new05.png");
$img->close();

?>