⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thumbnail.inc.php.svn-base

📁 prototype 实现网络相册的ajax界面。
💻 SVN-BASE
字号:
<?php/* make sure the image has a thumbnail */function ensure_thumbnail($base_name,$path,$size){  global $basedir;  $thumb_name=join('/',array($basedir,$path,$base_name.'.thumb.'.$size.'.jpg'));  if (!file_exists($thumb_name)){    $source_name=join('/',array($basedir,$path,$base_name.'.jpg'));    $source_img=imagecreatefromjpeg($source_name);    $source_x=imageSX($source_img);    $source_y=imageSY($source_img);    $thumb_x=($source_x > $source_y) ?       $size :       $size*($source_x/$source_y);    $thumb_y=($source_x < $source_y) ?       $size :       $size*($source_y/$source_x);    $thumb_img=ImageCreateTrueColor($thumb_x,$thumb_y);    imagecopyresampled(      $thumb_img,$source_img,      0,0,0,0,      $thumb_x,$thumb_y,      $source_x,$source_y    );    imagejpeg($thumb_img,$thumb_name);    imagedestroy($source_img);    imagedestroy($thumb_img);  }}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -