Elxis CMS Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: EDC: Download extensions for Elxis 4.x
 
Pages: [1]
  Print  
Author Topic: Thumbnails generation  (Read 2950 times)
datahell
Elxis Team
Hero Member
*****
Offline Offline

Posts: 7682



WWW
« on: September 28, 2007, 10:51:38 »

Elxis 2008 has a build-in feature for thumbnails generation using GD2 PHP library.

Usage

Parameters:
$w = thumbnail width in pixels (ie 64)
$h = thumbnail height in pixels (ie 64)
$keepratio = 0 or 1 (keep picture aspect ratio or not)
$image = image's path relative to Elxis root dir (i.e. images/logo.png)

We create the thumbnail by calling this file: /includes/thumb.php
We also need to pass thumbnail parameters in the url via the GET method.
We store thumbnail parameters in a variable named fi witch is constructed like this:

$fi = base64_encode($w.','.$h.','.$keepratio.','.$image);

Our final link would be:
$thumb_url =$mosConfig_live_site.'/includes/thumb.php?fi='.$fi;

And here is the html thumbnail:

echo '<img src="'.$thumb_url.' " width="'.$w.'" height="'.$h.'" alt="thumbnail" />';

If thumbnail can not be generated a default one is being displayed (images/M_images/story.png).

Notice: only local images are being  processing.
Valid image extensions: 'gif', 'jpeg', 'jpg', 'png', 'wbmp', 'bmp'
Valid $fi characters: a-z, A-Z, 0-9 and the symbols:   . / - , _
« Last Edit: September 28, 2007, 11:46:42 by datahell » Logged

Pages: [1]
  Print  
 
Jump to: