Version: 1

Type: Function

Category: Graphics

License: GNU General Public License

Description: Resize the image without altering or creating new resized image file. Display your image in thumb or specify the percentage size for fast loading displaying in the browser, no need to created another resized image file, this script will do the job for you, it will not alter the image itself, it will only resize once display in the browser. Sample how to use it : <img scr="resizer.php?imgfile=image.jpg&percent=0.3" border=0>



<?php
/*
Created by http://smallcapitalbusiness.com

Other Scripts we made:
 - Traffic Exchange Link (The New Generation)
 - Simply FAQ Script
 - Write Text to the Image
 - Image Resizer
 - Simple Web Monitoring
 - Capture TGP New listing
 - Exit Popup Exchange Service
 - Domain Redirection Service
 - TGP or Thumbnail Gallery Post

GNU : Do not remove our signature at the bottom page
*/


// File and new size
//$imgfile = 'smp.jpg';
//$percent = 0.2;
header('Content-type: image/jpeg');

list($width, $height) = getimagesize($imgfile);
$newwidth = $width * $percent;
$newheight = $height * $percent;

$thumb = ImageCreateTrueColor($newwidth,$newheight);
$source = imagecreatefromjpeg($imgfile);

imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagejpeg($thumb);
?>