topical media & game development
professional-sql-07-public-files-thumbnail.php / php
<?php
// include shared code
include '../lib/config.php';
// make sure users only access files in the albums
_GET['file'])) ? (BASEDIR . '/' . file && strpos(realpath(file))
{
header('Content-Type: image/jpeg');
// output thumbnail
switch (substr(file, '.') + 1))
{
// thumbnail is for jpeg image
case 'jpg':
case 'jpeg':
include '../lib/JpegThumbnail.php';
thumb = file), '', 100);
imagedestroy(thumbnail = new MovThumbnail();
// get and determine dimensions of thumbnail image
thumbnail->generate(width = imagesx(height = imagesy(icon = imagecreatefromjpeg('overlay.jpg');
icon);
icon);
// copy indicator to lower right-hand corner of thumbnail
imagecopymerge(icon, icon_width,
icon_height, 0, 0, icon_height, 100);
imagejpeg(thumb);
imagedestroy(
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.