PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of YoungHyeong Ryu   PHP Image Thumbail and Watermark   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: How to use
Class: PHP Image Thumbail and Watermark
Create thumbnail images or with watermarks
Author: By
Last change:
Date: 9 years ago
Size: 1,967 bytes
 

Contents

Class file image Download
<?php
header
("Content-Type: text/html; charset=utf-8");
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', On);


include_once
'class.image.php';
$image = new Class_image();


// if you want to create wortermark with text

//$params = array("src"=>"source/image/path/filename", "text"=>"what you want write on image","savepath"=>"save/image/path/filename");
//$params = array("src"=>"./samples/sample.jpg", "text"=>"shop-wiz.com", "savepath"=>"./samples/textwater.jpg");
//$image->impressWaterMark($params) ;


// if you want to create wortermark with image
//$params = array ("src"=>"source/image/path/filename","logo"=>"source/image/path/filename", "savepath"=>"save/image/path/filename", "quality"=>"9");
//$params = array ("src"=>"./samples/sample.jpg","logo"=>"./samples/logo.gif", "savepath"=>"./samples/imagewater.jpg", "quality"=>"9");
//$image->imageWaterMaking($params);


// if you want to create thumbnail
//$param = array("sourcefile"=>"/path/filename", "savepath"=>"./path", "max_width"=>"max value of thumbnail'width", "max_height"=>"max value of thumbnail'height");
//$param = array("sourcefile"=>"./samples/sample.jpg", "savepath"=>"./samples/thumbnail.jpg", "max_width"=>"300", "max_height"=>"300");
//$image->thumbnail($param);


// if you want to crop image
//$params = array("width"=>"crop width", "height"=>"coop height", "sourcefile"=>"source filepath/filenmae", "desc"=>"desc filepath/filenmae", "resize"=>true, "resize_w"=>"", "resize_h"=>"");
//$params = array("width"=>"100", "height"=>"100", "sourcefile"=>"./samples/sample.jpg", "desc"=>"./samples/crop.jpg");
//$image->cropcenter($params);

// if you want to convert an image format to
//$params = array("type" => "format chaning to(gif, jpeg)", "src"=>"path/from/sourcefile", "desc"=>"path/to/desc file");
//$params = array("type" => "png", "src"=>"./samples/sample.jpg", "desc"=>"./samples/sample.png");
//$image->convertformat($params);