EasyPhpThumbnail Class

Started on the old forum in December 2011 · view the original in the archive · old links redirect here

2 replies · 1,836 views · started 14 years ago · 1 min read

2 participants
arnage Lead · 811 posts #1

The EasyPhpThumbnail Image Effects class allows you to handle image manipulation and PHP thumbnail generation for GIF, JPG and PNG on-the-fly. Resize, crop, rotate, flip, save as, shadow, watermark, text, border, sharpen, blur, water ripple, mirror, perspective, twirl, animation, displacement maps and more!

  1. Download EasyPhpThumbnail and upload the example directory to your webserver
  2. Upload the class (PHP4 or PHP5 version) to the 'inc' example directory
  3. Open the example.php page in your browser

This will display a resized thumbnail. You can edit the example.php file and try one of the many examples.

The most simple example script would be:

<?php
include_once('inc/easyphpthumbnail.class.php');
$thumb = new easyphpthumbnail;
$thumb -> Createthumb('gfx/image.jpg');
?>

This would create a thumbnail with the standard settings and send the result to the browser (dynamic or on-the-fly thumbnail generation).

If you want to integrate the thumbnail on a webpage, you have to use a dynamic image. Create a separate PHP file called for example 'thumbnail.php' and add your code there:

<?php
if (isset($_REQUEST['thumb'])) {
 include_once('inc/easyphpthumbnail.class.php');
 // Your full path to the images
 $dir = str_replace(chr(92),chr(47),getcwd()) . '/gfx/';
 // Create the thumbnail
 $thumb = new easyphpthumbnail;
 $thumb -> Thumbsize = 300;
 $thumb -> Createthumb($dir . basename($_REQUEST['thumb']));
}
?>

Then on your page where you need the thumbnail add a link to the image like (save this sample as photo.php):

<?php
$file='image.jpg';
echo "<img src=\"thumbnail.php?thumb=$file\" alt=\"thumb\" />";
?>

Details here: EasyPhpThumbnail Class | MyWebMyMail.com

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
Attachments: easyphpthumbnail.zip

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close