I got some code that works greate 🙂
function thumbnail($image_path,$thumb_path,$image_name,$thumb_width)
{
$src_img = imagecreatefromjpeg("$image_path/$image_name");
$origw=imagesx($src_img);
$origh=imagesy($src_img);
$new_w = $thumb_width;
$diff=$origw/$new_w;
$new_h=$new_w;
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "$thumb_path");
return true;
}
//Create Thumbnail
if(eregi(".*jpg", $entry) || eregi(".*gif", $entry) || eregi(".*png", $entry) || eregi(".*tiff", $entry)) {
thumbnail("$partialPath\\","$thumbnail","$entry","100");
echo "<b><font color=blue>Created Thumbnail:</b></font><i> $partialPath\\thumb_$entry </i><br>";
} else {
echo "<b><font color=red>Unable to Create Thumbnail:</b></font><i>$partialPath\\$entry</i><br>";
}
I poped that in and it works very well
only thing is, how can I check to make sure the directory is there?
it seems that it dosnt create a directory automaticlly
like here is a example on what im trying to do
C:\Inetpub\wwwroot\photolab\Images\Alberto Martinez\2001 Digital photos\Homeland Line 2 10-17-2001\DCP02983.JPG
to
C:\Inetpub\wwwroot\photolab\thumbnail\Images\Alberto Martinez\2001 Digital photos\Homeland Line 2 10-17-2001\thumb_DCP02983.JPG
now it works because I have the dircetory there
but lets say from the src directory I add a new directory how can I make it so when it thumbnails and doesnt find the directory to the dist. then create it then put the thumbnail there
is this possible?