Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Carlos Sosa  >  Simple Thumbnails  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example of use.
Class: Simple Thumbnails
Create thumbnails images from image files
Author: By
Last change: - Fix and improve transparent colors support.
- Rewrite __construct method
- Replace save() method by saveAs()
- Rename printThumbnail to printImage and add $options parameter
- Rename getThumbnailAsString to getAsString and add $options parameter
- Improve autodetect image type, now isn't is need specify image type in any method.
- Remove magic methods printThumbnailAs... and saveAs...
- Permit access to thumb and image resources using function getImageResource and getThumbnailResource
- Minor changes in doThumbnail method
- Support only for png, gif, jpeg images.
Date: 2013-02-05 06:51
Size: 443 bytes
 

Contents

Class file image Download
<?php
$t1 
microtime(true);
require 
'Thumbnails.php';
$n = new Thumbnails('cancel48.png');
$n->doThumbnail(1024,768,  Thumbnails::IMAGE_CENTER Thumbnails::IMAGE_TOUCH_OUTSIDE)
    ->
saveAs('img3.gif'Thumbnails::IMAGE_FORMAT_GIF);
$t1 microtime(true) - $t1;
$t2 microtime(true);
$n1 imagecreatefromjpeg('img.jpg');
$t2 microtime(true) - $t2;
//$s = $n->getAsString(Thumbnails::IMAGE_FORMAT_PNG);
echo $t1' ' $t2;
?>