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 Kai Ming Choi  >  Image Edit Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of resize, watermark, simple effects
Class: Image Edit Class
Manipulate GIF, JPEG and PNG images
Author: By
Last change: changing priority
small change
Date: 2010-07-07 06:46
Size: 747 bytes
 

Contents

Class file image Download
<?
//ImageEdit Class Example
require "ImageEdit.class.php";

header('Content-Type: image/jpeg');    //tell the browser that it's jpg

$img = new ImageEdit("Desert.jpg");

$img->resize(400);    //resize the image to certain Width, hold the ratio

$img->watermark("wm2.png", -1, -1150);
    
//make a water mark, position: 1px, 1px from the right bottom corner
    //resize the water mark to certain width, hold the ratio

$img->effect("EDGEDETECT");    //add a effect
$img->effect("BLUR");    //add a effect

//Note that the order of watermark and effect will cause different results

//*You can modify the image resource directly using $img->image

$img->output("JPG"NULL50);    //output directly to the browser, reduce the quality to 50%
?>