Thumbnails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear members,

I hav the following code snippet wriiten by someone else and  
which I don't fully understand.
It is supposed to create thumbnails, but somehow the code isn't
working. i.e. the pictures cannot be found. (red cross).
I have checked the paths, and that seems to be ok
The pictures are collected with 
===========================lgo.php============================================
.....
<img src=\"../../lgopic.php?lgid=$thmid\" border=\"0\">
.....

========================lgopic.php============================================
<?
header('Content-Type: image/gif');
header('Content-transfer-encoding: binary');
  include('../../includes/dbconnect.php');
$clpid = $_GET['lgid'];
$query = "SELECT * FROM tblgo where ID='$clpid'";
$data = mysql_query($query);
$row = mysql_fetch_row($data);
$clpidd      = $row[0];
$clpcat      = $row[1];
$clpname     = $row[2];
$clpdate     = $row[4];
$imgst = "../../data/CID12/$clpcat/$clpname.jpg";

if (@fclose(@fopen("$imgst", "r"))) {
$imgst = $imgst;
}
else { $imgst ="../../data/errs/pic1.png";}
$im    = imagecreatefromjpeg($imgst);
function imagecross($im, $x, $y, $size = 65, $colour) {
imageline($im, $x+$size/2, $y+$size/2, $x-$size/2, $y-$size/2, $colour);
imageline($im, $x-$size/2, $y+$size, $x+$size/2, $y-$size, $colour);
}
imagecross($im, 10, 1, 65, $crosscolour);
imagecross($im, 30, 5, 65, $crosscolour);
imagecross($im, 50, 5, 65, $crosscolour);
imagecross($im, 70, 5, 65, $crosscolour);
imagepng($im);
imagedestroy($im);
readfile($imgst);
?>
the path of both php's is root/g/clp/
the path to the data   is root/data/...
Since I are a bit unfamilliar with creating tumbnails in this way I cannot quitte figur out 
what went wrong  ..
Can sombody help me and explain what is going on? 


Roland Parijs

Send instant messages to your online friends http://uk.messenger.yahoo.com 

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux