PHP Classes

File: examples/rotate/index.php

Recommend this page to a friend!
  Classes of hyyan   Tulip Image Processor   examples/rotate/index.php   Download  
File: examples/rotate/index.php
Role: Example script
Content type: text/plain
Description: index
Class: Tulip Image Processor
Apply different types of effects to images
Author: By
Last change:
Date: 11 years ago
Size: 815 bytes
 

Contents

Class file image Download
<?php
/**
 * Require The tuliIP class
 */
require_once '../../tulipIP/tulipIP.class.php';

/**
 * Load The Image From Source File
 */
$path = "../../src.jpg";
$image = tulipIP::loadImage($path);

/**
 * Note: flip method return new gd resource and has no effects in the given gd gd resource($image)
 */
$rotate_left = tulipIP::rotate($image, TIP_ROTATE_LEFT);
$rotate_right = tulipIP::rotate($image, TIP_ROTATE_RIGHT);
$rotate_upside_down = tulipIP::rotate($image, TIP_ROTATE_UPSIDE_DOWN);


/**
 * Save All created resources
 */

$dest = "./";

tulipIP::saveImage($dest, $image, TIP_PNG, "original");
tulipIP::saveImage($dest, $rotate_left, TIP_PNG, "rotate-left");
tulipIP::saveImage($dest, $rotate_right, TIP_PNG, "rotate-right");
tulipIP::saveImage($dest, $rotate_upside_down, TIP_PNG, "rotate-upside-down");
?>