Login   Register  
PHP Classes
elePHPant
Icontem

File: example.resizecrop.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mattias Pfeiffer  >  imgresize  >  example.resizecrop.php  >  Download  
File: example.resizecrop.php
Role: ???
Content type: text/plain
Description: This example shows how to use the resizecrop() function.
Class: imgresize
Class for resizing using imagemagick
Author: By
Last change:
Date: 2002-05-05 18:31
Size: 673 bytes
 

Contents

Class file image Download
<?
include_once("class.imgresize.php"); // include our class

/* 
        imgresize() class example. 
        Resize and crop image named 'moose.jpg';
*/ 

// set our header to image/jpeg for output 
header("Content-Type: image/jpeg"); 

// create our class 
$img = new imgresize(); 

// load our image
$img->loadimage("moose.jpg"); 

// resize our image to width 100 and height 100. We also want the image to be centered.
$img->resizecrop(100,100,true);

// saves our resized image as 'thumb_moose.jpg'. if the file exists, we'll overwrite.
//$img->saveto("thumb_moose.jpg",true);

// dump our resized image to the browser 
$img->output(); 

?>