<?php
require ("class.imagens.php");
$thumb = new imagens;
$thumb->img_w = 80; // pixels
$thumb->img_h = 80; // pixels
$thumb->img_arquivo = 'real-path-to-file.jpg';
$thumb->img_pos_x = "center";
$thumb->img_pos_y = "center";
$thumb->salvar = true;
$thumb->salvar_diretorio = 'cache/';
$thumb->salvar_nome = $thumb->img_arquivo;
$url_file_ext = explode('.', $thumb->img_arquivo);
$url_file_ext = end($url_file_ext);
$url_file_ext = strtolower($url_file_ext);
switch ($url_file_ext) {
case 'gif':
header('Content-type: image/gif');
break;
case 'png':
header('Content-type: image/png');
break;
default:
header('Content-type: image/jpeg');
break;
}
$expires = 60*60*24*365;//(1 dia)
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
echo $thumb->gerar();
}
unset($thumb);
?>
|