PHP Classes

File: demo3_resizing.php

Recommend this page to a friend!
  Classes of Jakob Riedle   Imagedit Pro   demo3_resizing.php   Download  
File: demo3_resizing.php
Role: Example script
Content type: text/plain
Description: Demo 3: Resizing
Class: Imagedit Pro
Image manipulation operations and face detection
Author: By
Last change: None
Date: 13 years ago
Size: 524 bytes
 

Contents

Class file image Download
<?php
   
include("class.imagedit.php");
    function
resize($url)
    {
       
$image = new imagedit($url);
       
$image->setHeight(
           
300 /* x */
           
, true /* Optional: Preserve Aspect Ratio */
       
);
       
$image->setWidth(
           
200 /* x */
           
, false /* Optional: Preserve Aspect Ratio */
       
);
       
        return
$image->getPNG();
    }
?>
<body style="background: yellow;">
    <h1>Imagedit Demo 3: Resizing</h1>
    <img style="border: 1px solid black;" src="data:image/png;base64,<?=base64_encode(resize("test.png"))?>"></img>
</body>