PHP Classes

phpThumbnailer: Create image thumbnails on the fly

Recommend this page to a friend!
  Info   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 71%Total: 4,115 All time: 744 This week: 138Up
Version License Categories
phpthumbnailer 1.0.0GNU General Publi...Graphics


This class can be used to create thumbnail images on the fly.

It can resize input images so the rescaled images do not exceed given width and height limits.

It supports resizing images in the GIF, JPEG and PNG formats.

The resized images can be served as the current PHP script output or saved of a new file.

Picture of Hidayet Dogan
Name: Hidayet Dogan <contact>
Classes: 1 package by
Country: Turkey Turkey
Age: ???
All time rank: 74113 in Turkey Turkey
Week rank: 346 Up9 in Turkey Turkey Up

By Hidayet Dogan - - March 29, 2005 phpThumbnailer 1.2 - phpThumbnailer is a simple PHP class for create thumbnails or resize images. Requirements ------------ GD extension enabled PHP. Sample Use ---------- <? include("class.Thumbnail.php"); $tn_image = new Thumbnail("sample.png", 0, 0, 50); # | | | | # | | | +-- Percent (optional) # | | +-- Maximum height (optional) # | +-- Maximum width (optional) # +-- Original image filename # To show $tn_image->show(); # To show (it won't show image) $tn_image->save("tn_sample.png"); # or $tn_image->show("tn_sample.png"); ?> For more samples see samples/sample.html... Note ---- Version of GD library older than gd-1.6 support GIF format images, and do not support PNG images, where versions greather than gd-1.6 support PNG, not GIF. In order to create thumbnails in JPEG format, you will need to obtain and install jpeg-6b library, and then recompile gd to make use of jpeg-6b. You will also have to compile PHP with --with-jpeg-dir=/path/to/jpeg-6b. Sorry for my stupid english. Disclaimer ---------- No responsiblity for any security risks or software bugs whatsoever is accepted by the author(s).
  Files folder image Files  
File Role Description
Files folder imagesample (7 files)
Accessible without login Plain text file ChangeLog Doc. ChangeLog
Plain text file class.Thumbnail.php Class Source Code
Accessible without login Plain text file LICENSE Lic. LICENSE
Accessible without login Plain text file README Doc. README

  Files folder image Files  /  sample  
File Role Description
  Accessible without login HTML file sample.html Data Sample Usage
  Accessible without login Image file sample.jpg Data Sample JPEG File
  Accessible without login Plain text file sample1.php Example Sample Script
  Accessible without login Plain text file sample2.php Example Sample Script
  Accessible without login Plain text file sample3.php Example Sample Script
  Accessible without login Plain text file sample4.php Example Sample Script
  Accessible without login Plain text file save1.php Example Sample Script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:744
This week:138Up
 User Ratings  
 All time