Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
EDC:
Download extensions for Elxis CMS
.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Elxis 2008 developers guide
»
Thumbnails generation
« previous
next »
Print
Pages: [
1
]
Author
Topic: Thumbnails generation (Read 10412 times)
datahell
Elxis Team
Hero Member
Posts: 10356
Thumbnails generation
«
on:
September 28, 2007, 11: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, 12:46:42 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Elxis 2008 developers guide
»
Thumbnails generation