Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

〓Discuz! 7.0 主题封面 [修复6.1版本几个错误并优化连接]

[复制链接]
广告 发表于 2009-4-25 19:26:24 | 显示全部楼层
支持一个来 、、、、
回复

使用道具 举报

weekeemong 发表于 2009-4-26 02:25:53 | 显示全部楼层
只是想支持下作者 -* *
回复

使用道具 举报

大眼夹 发表于 2009-5-4 20:00:57 | 显示全部楼层
太棒了!就是我需要的~支持一下
回复

使用道具 举报

大眼夹 发表于 2009-5-4 20:14:53 | 显示全部楼层
为什么有的缩略图显示不出来~是一个叉叉,但是文件确确实实是存在的……
回复

使用道具 举报

合肥大学生社区 发表于 2009-5-7 14:05:33 | 显示全部楼层
<!--主题封面 by 郭鑫-->

                                                        <!--{if isset($tat



[$thread['tid']][0])}-->

                                                                                <a



href="viewthread.php?tid=$thread[tid]&amp;extra=$extra"><img src="{$tat[$thread['tid']][0]['attthumb']}&width=100" class="attach



threadicon" /></a><br>

                                                        <!--{/if}-->

                                                        <!--/主题封面 by 郭鑫-->



图片不能显示的 把这段代码修改下就可以了
回复

使用道具 举报

大眼夹 发表于 2009-5-7 16:39:26 | 显示全部楼层
本帖最后由 大眼夹 于 2009-5-7 16:53 编辑

楼上的方法貌似不管用……
LZ提供的代码有一个动态生成100px缩略图的功能,事实上问题就出在这里
我论坛采用的是ImageMagick处理图片而不是GD,但是thumbnail.inc.php貌似是采用GD的,大多数图片不会出现问题,但是有个别图片有问题,将其下载回来后发现jpg的二进制数据是生成了的,但是文件前面有一行PHP的警告信息
:<br />
<b>Warning</b>:  exif_read_data(0905022343dcf1d004a73c487a.jpg.thumb.jpg) [<a href='exif_read_data#error_ifd'>exif_read_data</a>]: Illegal IFD offset in <b>D:\bbs\***********\include\thumbnail.inc.php</b> on line <b>613</b><br />



元凶是thumbnail.inc.php文件里面的gatherImageMeta(),可能和ImageMagick有冲突,不过它是获得exif信息之用,由于我们只需要动态生成小图标,所以要不要也无所谓了,把它注释掉即可,另外前面有一个call它的地方也要注释掉

附上修改好的thumbnail.inc.php文件

  1. <?php
  2. /**
  3. * thumbnail.inc.php
  4. *
  5. * @author                 Ian Selby (ian@gen-x-design.com)
  6. * @copyright         Copyright 2006
  7. * @version         1.1 (PHP5)
  8. *
  9. */

  10. /**
  11. * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
  12. *
  13. */
  14. class Thumbnail {
  15.     /**
  16.      * Error message to display, if any
  17.      *
  18.      * @var string
  19.      */
  20.     private $errmsg;
  21.     /**
  22.      * Whether or not there is an error
  23.      *
  24.      * @var boolean
  25.      */
  26.     private $error;
  27.     /**
  28.      * Format of the image file
  29.      *
  30.      * @var string
  31.      */
  32.     private $format;
  33.     /**
  34.      * File name and path of the image file
  35.      *
  36.      * @var string
  37.      */
  38.     private $fileName;
  39.     /**
  40.      * Image meta data if any is available (jpeg/tiff) via the exif library
  41.      *
  42.      * @var array
  43.      */
  44.     public $imageMeta;
  45.     /**
  46.      * Current dimensions of working image
  47.      *
  48.      * @var array
  49.      */
  50.     private $currentDimensions;
  51.     /**
  52.      * New dimensions of working image
  53.      *
  54.      * @var array
  55.      */
  56.     private $newDimensions;
  57.     /**
  58.      * Image resource for newly manipulated image
  59.      *
  60.      * @var resource
  61.      */
  62.     private $newImage;
  63.     /**
  64.      * Image resource for image before previous manipulation
  65.      *
  66.      * @var resource
  67.      */
  68.     private $oldImage;
  69.     /**
  70.      * Image resource for image being currently manipulated
  71.      *
  72.      * @var resource
  73.      */
  74.     private $workingImage;
  75.     /**
  76.      * Percentage to resize image by
  77.      *
  78.      * @var int
  79.      */
  80.     private $percent;
  81.     /**
  82.      * Maximum width of image during resize
  83.      *
  84.      * @var int
  85.      */
  86.     private $maxWidth;
  87.     /**
  88.      * Maximum height of image during resize
  89.      *
  90.      * @var int
  91.      */
  92.     private $maxHeight;

  93.     /**
  94.      * Class constructor
  95.      *
  96.      * @param string $fileName
  97.      * @return Thumbnail
  98.      */
  99.     public function __construct($fileName) {
  100.         //make sure the GD library is installed
  101.             if(!function_exists("gd_info")) {
  102.                 echo 'You do not have the GD Library installed.  This class requires the GD library to function properly.' . "\n";
  103.                 echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
  104.                 exit;
  105.         }
  106.             //initialize variables
  107.         $this->errmsg               = '';
  108.         $this->error                = false;
  109.         $this->currentDimensions    = array();
  110.         $this->newDimensions        = array();
  111.         $this->fileName             = $fileName;
  112.         $this->imageMeta                        = array();
  113.         $this->percent              = 100;
  114.         $this->maxWidth             = 0;
  115.         $this->maxHeight            = 0;

  116.         //check to see if file exists
  117.         if(!file_exists($this->fileName)) {
  118.             $this->errmsg = 'File not found';
  119.             $this->error = true;
  120.         }
  121.         //check to see if file is readable
  122.         elseif(!is_readable($this->fileName)) {
  123.             $this->errmsg = 'File is not readable';
  124.             $this->error = true;
  125.         }

  126.         //if there are no errors, determine the file format
  127.         if($this->error == false) {
  128.             //check if gif
  129.             if(stristr(strtolower($this->fileName),'.gif')) $this->format = 'GIF';
  130.             //check if jpg
  131.             elseif(stristr(strtolower($this->fileName),'.jpg') || stristr(strtolower($this->fileName),'.jpeg')) $this->format = 'JPG';
  132.             //check if png
  133.             elseif(stristr(strtolower($this->fileName),'.png')) $this->format = 'PNG';
  134.             //unknown file format
  135.             else {
  136.                 $this->errmsg = 'Unknown file format';
  137.                 $this->error = true;
  138.             }
  139.         }

  140.         //initialize resources if no errors
  141.         if($this->error == false) {
  142.             switch($this->format) {
  143.                 case 'GIF':
  144.                     $this->oldImage = ImageCreateFromGif($this->fileName);
  145.                     break;
  146.                 case 'JPG':
  147.                     $this->oldImage = ImageCreateFromJpeg($this->fileName);
  148.                     break;
  149.                 case 'PNG':
  150.                     $this->oldImage = ImageCreateFromPng($this->fileName);
  151.                     break;
  152.             }

  153.             $size = GetImageSize($this->fileName);
  154.             $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
  155.             $this->newImage = $this->oldImage;
  156.             //$this->gatherImageMeta();        这里Call那一段有问题的代码也注释掉
  157.         }

  158.         if($this->error == true) {
  159.             $this->showErrorImage();
  160.             break;
  161.         }
  162.     }

  163.     /**
  164.      * Class destructor
  165.      *
  166.      */
  167.     public function __destruct() {
  168.         if(is_resource($this->newImage)) @ImageDestroy($this->newImage);
  169.         if(is_resource($this->oldImage)) @ImageDestroy($this->oldImage);
  170.         if(is_resource($this->workingImage)) @ImageDestroy($this->workingImage);
  171.     }

  172.     /**
  173.      * Returns the current width of the image
  174.      *
  175.      * @return int
  176.      */
  177.     private function getCurrentWidth() {
  178.         return $this->currentDimensions['width'];
  179.     }

  180.     /**
  181.      * Returns the current height of the image
  182.      *
  183.      * @return int
  184.      */
  185.     private function getCurrentHeight() {
  186.         return $this->currentDimensions['height'];
  187.     }

  188.     /**
  189.      * Calculates new image width
  190.      *
  191.      * @param int $width
  192.      * @param int $height
  193.      * @return array
  194.      */
  195.     private function calcWidth($width,$height) {
  196.         $newWp = (100 * $this->maxWidth) / $width;
  197.         $newHeight = ($height * $newWp) / 100;
  198.         return array('newWidth'=>intval($this->maxWidth),'newHeight'=>intval($newHeight));
  199.     }

  200.     /**
  201.      * Calculates new image height
  202.      *
  203.      * @param int $width
  204.      * @param int $height
  205.      * @return array
  206.      */
  207.     private function calcHeight($width,$height) {
  208.         $newHp = (100 * $this->maxHeight) / $height;
  209.         $newWidth = ($width * $newHp) / 100;
  210.         return array('newWidth'=>intval($newWidth),'newHeight'=>intval($this->maxHeight));
  211.     }

  212.     /**
  213.      * Calculates new image size based on percentage
  214.      *
  215.      * @param int $width
  216.      * @param int $height
  217.      * @return array
  218.      */
  219.     private function calcPercent($width,$height) {
  220.         $newWidth = ($width * $this->percent) / 100;
  221.         $newHeight = ($height * $this->percent) / 100;
  222.         return array('newWidth'=>intval($newWidth),'newHeight'=>intval($newHeight));
  223.     }

  224.     /**
  225.      * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
  226.      *
  227.      * @param int $width
  228.      * @param int $height
  229.      */
  230.     private function calcImageSize($width,$height) {
  231.         $newSize = array('newWidth'=>$width,'newHeight'=>$height);

  232.         if($this->maxWidth > 0) {

  233.             $newSize = $this->calcWidth($width,$height);

  234.             if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
  235.                 $newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
  236.             }

  237.             //$this->newDimensions = $newSize;
  238.         }

  239.         if($this->maxHeight > 0) {
  240.             $newSize = $this->calcHeight($width,$height);

  241.             if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
  242.                 $newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
  243.             }

  244.             //$this->newDimensions = $newSize;
  245.         }

  246.         $this->newDimensions = $newSize;
  247.     }

  248.     /**
  249.      * Calculates new image size based percentage
  250.      *
  251.      * @param int $width
  252.      * @param int $height
  253.      */
  254.     private function calcImageSizePercent($width,$height) {
  255.         if($this->percent > 0) {
  256.             $this->newDimensions = $this->calcPercent($width,$height);
  257.         }
  258.     }

  259.     /**
  260.      * Displays error image
  261.      *
  262.      */
  263.     private function showErrorImage() {
  264.         header('Content-type: image/png');
  265.         $errImg = ImageCreate(220,25);
  266.         $bgColor = imagecolorallocate($errImg,0,0,0);
  267.         $fgColor1 = imagecolorallocate($errImg,255,255,255);
  268.         $fgColor2 = imagecolorallocate($errImg,255,0,0);
  269.         imagestring($errImg,3,6,6,'Error:',$fgColor2);
  270.         imagestring($errImg,3,55,6,$this->errmsg,$fgColor1);
  271.         imagepng($errImg);
  272.         imagedestroy($errImg);
  273.     }

  274.     /**
  275.      * Resizes image to maxWidth x maxHeight
  276.      *
  277.      * @param int $maxWidth
  278.      * @param int $maxHeight
  279.      */
  280.     public function resize($maxWidth = 0, $maxHeight = 0) {
  281.         $this->maxWidth = $maxWidth;
  282.         $this->maxHeight = $maxHeight;

  283.         $this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);

  284.                 if(function_exists("ImageCreateTrueColor")) {
  285.                         $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
  286.                 }
  287.                 else {
  288.                         $this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
  289.                 }

  290.                 ImageCopyResampled(
  291.                         $this->workingImage,
  292.                         $this->oldImage,
  293.                         0,
  294.                         0,
  295.                         0,
  296.                         0,
  297.                         $this->newDimensions['newWidth'],
  298.                         $this->newDimensions['newHeight'],
  299.                         $this->currentDimensions['width'],
  300.                         $this->currentDimensions['height']
  301.                 );

  302.                 $this->oldImage = $this->workingImage;
  303.                 $this->newImage = $this->workingImage;
  304.                 $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
  305.                 $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
  306.         }

  307.         /**
  308.          * Resizes the image by $percent percent
  309.          *
  310.          * @param int $percent
  311.          */
  312.         public function resizePercent($percent = 0) {
  313.             $this->percent = $percent;

  314.             $this->calcImageSizePercent($this->currentDimensions['width'],$this->currentDimensions['height']);

  315.                 if(function_exists("ImageCreateTrueColor")) {
  316.                         $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
  317.                 }
  318.                 else {
  319.                         $this->workingImage = ImageCreate($this->newDimensions['newWidth'],$this->newDimensions['newHeight']);
  320.                 }

  321.                 ImageCopyResampled(
  322.                         $this->workingImage,
  323.                         $this->oldImage,
  324.                         0,
  325.                         0,
  326.                         0,
  327.                         0,
  328.                         $this->newDimensions['newWidth'],
  329.                         $this->newDimensions['newHeight'],
  330.                         $this->currentDimensions['width'],
  331.                         $this->currentDimensions['height']
  332.                 );

  333.                 $this->oldImage = $this->workingImage;
  334.                 $this->newImage = $this->workingImage;
  335.                 $this->currentDimensions['width'] = $this->newDimensions['newWidth'];
  336.                 $this->currentDimensions['height'] = $this->newDimensions['newHeight'];
  337.         }

  338.         /**
  339.          * Crops the image from calculated center in a square of $cropSize pixels
  340.          *
  341.          * @param int $cropSize
  342.          */
  343.         public function cropFromCenter($cropSize) {
  344.             if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
  345.             if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];

  346.             $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
  347.             $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);

  348.             if(function_exists("ImageCreateTrueColor")) {
  349.                         $this->workingImage = ImageCreateTrueColor($cropSize,$cropSize);
  350.                 }
  351.                 else {
  352.                         $this->workingImage = ImageCreate($cropSize,$cropSize);
  353.                 }

  354.                 imagecopyresampled(
  355.             $this->workingImage,
  356.             $this->oldImage,
  357.             0,
  358.             0,
  359.             $cropX,
  360.             $cropY,
  361.             $cropSize,
  362.             $cropSize,
  363.             $cropSize,
  364.             $cropSize
  365.                 );

  366.                 $this->oldImage = $this->workingImage;
  367.                 $this->newImage = $this->workingImage;
  368.                 $this->currentDimensions['width'] = $cropSize;
  369.                 $this->currentDimensions['height'] = $cropSize;
  370.         }

  371.         /**
  372.          * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
  373.          *
  374.          * @param int $startX
  375.          * @param int $startY
  376.          * @param int $width
  377.          * @param int $height
  378.          */
  379.         public function crop($startX,$startY,$width,$height) {
  380.             //make sure the cropped area is not greater than the size of the image
  381.             if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
  382.             if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
  383.             //make sure not starting outside the image
  384.             if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
  385.             if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
  386.             if($startX < 0) $startX = 0;
  387.             if($startY < 0) $startY = 0;

  388.             if(function_exists("ImageCreateTrueColor")) {
  389.                         $this->workingImage = ImageCreateTrueColor($width,$height);
  390.                 }
  391.                 else {
  392.                         $this->workingImage = ImageCreate($width,$height);
  393.                 }

  394.                 imagecopyresampled(
  395.             $this->workingImage,
  396.             $this->oldImage,
  397.             0,
  398.             0,
  399.             $startX,
  400.             $startY,
  401.             $width,
  402.             $height,
  403.             $width,
  404.             $height
  405.                 );

  406.                 $this->oldImage = $this->workingImage;
  407.                 $this->newImage = $this->workingImage;
  408.                 $this->currentDimensions['width'] = $width;
  409.                 $this->currentDimensions['height'] = $height;
  410.         }

  411.         /**
  412.          * Outputs the image to the screen, or saves to $name if supplied.  Quality of JPEG images can be controlled with the $quality variable
  413.          *
  414.          * @param int $quality
  415.          * @param string $name
  416.          */
  417.         public function show($quality=100,$name = '') {
  418.             switch($this->format) {
  419.                 case 'GIF':
  420.                     if($name != '') {
  421.                         ImageGif($this->newImage,$name);
  422.                     }
  423.                     else {
  424.                        header('Content-type: image/gif');
  425.                        ImageGif($this->newImage);
  426.                     }
  427.                     break;
  428.                 case 'JPG':
  429.                     if($name != '') {
  430.                         ImageJpeg($this->newImage,$name,$quality);
  431.                     }
  432.                     else {
  433.                        header('Content-type: image/jpeg');
  434.                        ImageJpeg($this->newImage,'',$quality);
  435.                     }
  436.                     break;
  437.                 case 'PNG':
  438.                     if($name != '') {
  439.                         ImagePng($this->newImage,$name);
  440.                     }
  441.                     else {
  442.                        header('Content-type: image/png');
  443.                        ImagePng($this->newImage);
  444.                     }
  445.                     break;
  446.             }
  447.         }

  448.         /**
  449.          * Saves image as $name (can include file path), with quality of # percent if file is a jpeg
  450.          *
  451.          * @param string $name
  452.          * @param int $quality
  453.          */
  454.         public function save($name,$quality=100) {
  455.             $this->show($quality,$name);
  456.         }

  457.         /**
  458.          * Creates Apple-style reflection under image, optionally adding a border to main image
  459.          *
  460.          * @param int $percent
  461.          * @param int $reflection
  462.          * @param int $white
  463.          * @param bool $border
  464.          * @param string $borderColor
  465.          */
  466.         public function createReflection($percent,$reflection,$white,$border = true,$borderColor = '#a4a4a4') {
  467.         $width = $this->currentDimensions['width'];
  468.         $height = $this->currentDimensions['height'];

  469.         $reflectionHeight = intval($height * ($reflection / 100));
  470.         $newHeight = $height + $reflectionHeight;
  471.         $reflectedPart = $height * ($percent / 100);

  472.         $this->workingImage = ImageCreateTrueColor($width,$newHeight);

  473.         ImageAlphaBlending($this->workingImage,true);

  474.         $colorToPaint = ImageColorAllocateAlpha($this->workingImage,255,255,255,0);
  475.         ImageFilledRectangle($this->workingImage,0,0,$width,$newHeight,$colorToPaint);

  476.         imagecopyresampled(
  477.                             $this->workingImage,
  478.                             $this->newImage,
  479.                             0,
  480.                             0,
  481.                             0,
  482.                             $reflectedPart,
  483.                             $width,
  484.                             $reflectionHeight,
  485.                             $width,
  486.                             ($height - $reflectedPart));
  487.         $this->imageFlipVertical();

  488.         imagecopy($this->workingImage,$this->newImage,0,0,0,0,$width,$height);

  489.         imagealphablending($this->workingImage,true);

  490.         for($i=0;$i<$reflectionHeight;$i++) {
  491.             $colorToPaint = imagecolorallocatealpha($this->workingImage,255,255,255,($i/$reflectionHeight*-1+1)*$white);
  492.             imagefilledrectangle($this->workingImage,0,$height+$i,$width,$height+$i,$colorToPaint);
  493.         }

  494.         if($border == true) {
  495.             $rgb = $this->hex2rgb($borderColor,false);
  496.             $colorToPaint = imagecolorallocate($this->workingImage,$rgb[0],$rgb[1],$rgb[2]);
  497.             imageline($this->workingImage,0,0,$width,0,$colorToPaint); //top line
  498.             imageline($this->workingImage,0,$height,$width,$height,$colorToPaint); //bottom line
  499.             imageline($this->workingImage,0,0,0,$height,$colorToPaint); //left line
  500.             imageline($this->workingImage,$width-1,0,$width-1,$height,$colorToPaint); //right line
  501.         }

  502.         $this->oldImage = $this->workingImage;
  503.                 $this->newImage = $this->workingImage;
  504.                 $this->currentDimensions['width'] = $width;
  505.                 $this->currentDimensions['height'] = $newHeight;
  506.         }

  507.         /**
  508.          * Inverts working image, used by reflection function
  509.          *
  510.          */
  511.         private function imageFlipVertical() {
  512.             $x_i = imagesx($this->workingImage);
  513.             $y_i = imagesy($this->workingImage);

  514.             for($x = 0; $x < $x_i; $x++) {
  515.                 for($y = 0; $y < $y_i; $y++) {
  516.                     imagecopy($this->workingImage,$this->workingImage,$x,$y_i - $y - 1, $x, $y, 1, 1);
  517.                 }
  518.             }
  519.         }

  520.         /**
  521.          * Converts hexidecimal color value to rgb values and returns as array/string
  522.          *
  523.          * @param string $hex
  524.          * @param bool $asString
  525.          * @return array|string
  526.          */
  527.         private function hex2rgb($hex, $asString = false) {
  528.         // strip off any leading #
  529.         if (0 === strpos($hex, '#')) {
  530.            $hex = substr($hex, 1);
  531.         } else if (0 === strpos($hex, '&H')) {
  532.            $hex = substr($hex, 2);
  533.         }

  534.         // break into hex 3-tuple
  535.         $cutpoint = ceil(strlen($hex) / 2)-1;
  536.         $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);

  537.         // convert each tuple to decimal
  538.         $rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
  539.         $rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
  540.         $rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);

  541.         return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
  542.     }
  543.    
  544.     /**
  545.      * Reads selected exif meta data from jpg images and populates $this->imageMeta with appropriate values if found
  546.      *
  547.      */
  548. /**这一段貌似和ImageMagick不兼容,把它禁用了       大眼夹09-05-07
  549.     private function gatherImageMeta() {
  550.             //only attempt to retrieve info if exif exists
  551.             if(function_exists("exif_read_data") && $this->format == 'JPG') {
  552.                         $imageData = exif_read_data($this->fileName);
  553.                         if(isset($imageData['Make']))
  554.                                 $this->imageMeta['make'] = ucwords(strtolower($imageData['Make']));
  555.                         if(isset($imageData['Model']))
  556.                                 $this->imageMeta['model'] = $imageData['Model'];
  557.                         if(isset($imageData['COMPUTED']['ApertureFNumber'])) {
  558.                                 $this->imageMeta['aperture'] = $imageData['COMPUTED']['ApertureFNumber'];
  559.                                 $this->imageMeta['aperture'] = str_replace('/','',$this->imageMeta['aperture']);
  560.                         }
  561.                         if(isset($imageData['ExposureTime'])) {
  562.                                 $exposure = explode('/',$imageData['ExposureTime']);
  563.                                 $exposure = round($exposure[1]/$exposure[0],-1);
  564.                                 $this->imageMeta['exposure'] = '1/' . $exposure . ' second';
  565.                         }
  566.                         if(isset($imageData['Flash'])) {
  567.                                 if($imageData['Flash'] > 0) {
  568.                                         $this->imageMeta['flash'] = 'Yes';
  569.                                 }
  570.                                 else {
  571.                                         $this->imageMeta['flash'] = 'No';
  572.                                 }
  573.                         }
  574.                         if(isset($imageData['FocalLength'])) {
  575.                                 $focus = explode('/',$imageData['FocalLength']);
  576.                                 $this->imageMeta['focalLength'] = round($focus[0]/$focus[1],2) . ' mm';
  577.                         }
  578.                         if(isset($imageData['DateTime'])) {
  579.                                 $date = $imageData['DateTime'];
  580.                                 $date = explode(' ',$date);
  581.                                 $date = str_replace(':','-',$date[0]) . ' ' . $date[1];
  582.                                 $this->imageMeta['dateTaken'] = date('m/d/Y g:i A',strtotime($date));
  583.                         }
  584.             }
  585.     }
  586.    
  587. */
  588.    
  589.     /**
  590.      * Rotates image either 90 degrees clockwise or counter-clockwise
  591.      *
  592.      * @param string $direction
  593.      */
  594.     public function rotateImage($direction = 'CW') {
  595.             if($direction == 'CW') {
  596.                     $this->workingImage = imagerotate($this->workingImage,-90,0);
  597.             }
  598.             else {
  599.                     $this->workingImage = imagerotate($this->workingImage,90,0);
  600.             }
  601.             $newWidth = $this->currentDimensions['height'];
  602.             $newHeight = $this->currentDimensions['width'];
  603.                 $this->oldImage = $this->workingImage;
  604.                 $this->newImage = $this->workingImage;
  605.                 $this->currentDimensions['width'] = $newWidth;
  606.                 $this->currentDimensions['height'] = $newHeight;
  607.     }
  608. }
  609. ?>
复制代码
回复

使用道具 举报

羽翼时空 发表于 2009-5-14 19:32:21 | 显示全部楼层
本帖最后由 羽翼时空 于 2009-5-15 16:14 编辑

手了~~

http://bbs.saint-comic.cn/threadicon.php?filename=http://bbs.saint-comic.cn/attachments/month_0904/0904282020a6a390de64776e70.jpg&width=100&height=100
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in D:\inetpub\vhosts\saint-comic.cn\httpdocs\bbs\include\thumbnail.inc.php on line 21
好像我空间PHP版本不支持这种语法。
回复

使用道具 举报

奇跡の海 发表于 2009-5-15 16:50:08 | 显示全部楼层
支持支持!!!!!!!!!!!!!!!!!!1
回复

使用道具 举报

zhuangshivip 发表于 2009-5-20 01:16:47 | 显示全部楼层
10# lianxiaming
回复

使用道具 举报

shawn82 发表于 2009-5-28 03:31:27 | 显示全部楼层
本帖最后由 shawn82 于 2009-5-28 04:05 编辑


楼主,我安装了你的主题封面
我个人好喜欢,我有个问题就是(请看图)
黄色高亮的.因为有些图片排到不齐,看起来不好看
我知道是图片大小的问题,但是我想把主题列表弄成和图片红色框的主题列表看齐
楼主能帮忙下吗?

本人论坛的自贴区
http://fai-mang.net/forum-186-1.html

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-4-24 14:42 , Processed in 0.102792 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表