diff --git a/app/admin/view/default/site/attachment/index.html b/app/admin/view/default/site/attachment/index.html index c9cb225b0102154f5acf2c7a1e486db971bd43fc..79b1f356e253409e2149e874784dd9da10255c16 100644 --- a/app/admin/view/default/site/attachment/index.html +++ b/app/admin/view/default/site/attachment/index.html @@ -36,20 +36,6 @@ - -
- - -
- -

1. 默认否、建议开启上传图片重新绘制、防止木马病毒图片上传

-

2. 开启后gif动态图片将失效、由于重新绘制图片大小也会改变

-
-
diff --git a/extend/base/Uploader.php b/extend/base/Uploader.php index f7419a5f6919d82c66a7db5988582fa816a97444..b642c96ab31fc7736e5b5f6c3c8e76086590a3df 100755 --- a/extend/base/Uploader.php +++ b/extend/base/Uploader.php @@ -237,55 +237,8 @@ class Uploader return; } - // 如未安装相应的gd库则直接存储文件 - // 未开启重新绘制 - $is_move = false; - - // 是否开启图片重新绘制 - if(MyC('is_upload_images_redraw', 0) == 1) - { - switch($this->fileType) - { - case '.png': - if(function_exists('imagecreatefrompng')) - { - $image = imagecreatefrompng($file["tmp_name"]); //PNG - imagesavealpha($image, true); //这里很重要 意思是不要丢了$sourePic图像的透明色; - $width = imagesx($image); //图宽度 - $heigh = imagesy($image); //图高度 - $thumb = imagecreatetruecolor($width, $heigh); - imagealphablending($thumb, false); //这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色; - imagesavealpha($thumb, true); //这里很重要,意思是不要丢了$thumb图像的透明色; - if(imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $heigh, $width, $heigh)) - { - imagepng($thumb, $this->filePath); - } - } else { - $is_move = true; - } - break; - case '.gif': - if(function_exists('imagecreatefromgif')) - { - @imagegif(@imagecreatefromgif($file["tmp_name"]), $this->filePath); - } else { - $is_move = true; - } - break; - default: - if(function_exists('imagecreatefromjpeg')) - { - @imagejpeg(@imagecreatefromjpeg($file["tmp_name"]), $this->filePath, 100); - } else { - $is_move = true; - } - } - } else { - $is_move = true; - } - // 是否需要直接存储文件 - if($is_move && !move_uploaded_file($file["tmp_name"], $this->filePath)) + if(!move_uploaded_file($file["tmp_name"], $this->filePath)) { $this->stateInfo = $this->getStateInfo("ERROR_FILE_MOVE"); }