Skip to content

Commit 2b91736

Browse files
committed
根据阿飞原文件小幅更新UploadPlugin与Watermark插件
1 parent fa782cf commit 2b91736

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

UploadPlugin/Plugin.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
/**
33
* 上传、删除插件和模板
44
*
5-
* @category system
65
* @package Upload Plugin
76
* @author DEFE
8-
* @version 1.1.2
7+
* @version 1.1.3
98
* @dependence 10.6.24-*
109
* @link http://defe.me
1110
*/
@@ -28,10 +27,10 @@ public static function activate()
2827
}
2928
if(!function_exists('file_put_contents') && !function_exists('fopen')){
3029
throw new Typecho_Plugin_Exception(_t('file_put_contents、fopen函数被禁用, 无法正常使用此插件'));
31-
throw new Typecho_Plugin_Exception(_t('插件目录无写入权限, 无法正常使用此插件'));
3230
}
3331
Helper::addPanel(1, 'UploadPlugin/panel.php', _t('上传'), _t('在线插件管理'), 'administrator');
3432
Helper::addAction('upload-plugin', 'UploadPlugin_Action');
33+
//return _t('请设置插件仓库的服务地址,以便能在线安装插件!');
3534
}
3635

3736
/**

UploadPlugin/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### 自动安装管理扩展插件UploadPlugin v1.1.2
1+
### 自动安装管理扩展插件UploadPlugin v1.1.3
22

33
启用后可在菜单“控制台”-“上传”中自动安装插件/主题压缩包,或直接删除禁用的插件/主题,省去FTP等操作。
44

5-
> 修正路径检测、action报错和面板效果,兼容Typecho1.0
5+
> 修正路径检测、action报错和面板效果,兼容Typecho1.1
66
77
###### 更多详见作者博客:http://defe.me/prg/442.html

Watermark/AnkeCalligraph.TTF

41.5 KB
Binary file not shown.

Watermark/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
实现指定图片或文本作为水印显示在附件插图上,可设置方位、大小、字体等,支持缓存。
44

5-
> 加上默认字体,修正注释
5+
> 更新字体修正注释
66
77
###### 更多详见作者博客:http://defe.me/prg/431.html

Watermark/class.php

+15-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,27 @@ function setFont($font, $text, $size, $color){
5555
* @param $type
5656
* @return resource
5757
*/
58-
function getType($img, $type)
59-
{
58+
function getType($img, $type){
6059
switch($type){
6160
case 1:
6261
$im = imagecreatefromgif($img);
6362
break;
6463
case 2:
64+
$exif = exif_read_data($img, 'EXIF');
6565
$im = imagecreatefromjpeg($img);
66+
if($exif!=false){
67+
switch($exif['Orientation']) {
68+
case 8:
69+
$im = imagerotate($im,90,0);
70+
break;
71+
case 3:
72+
$im = imagerotate($im,180,0);
73+
break;
74+
case 6:
75+
$im = imagerotate($im,-90,0);
76+
break;
77+
}
78+
}
6679
break;
6780
case 3:
6881
$im = imagecreatefrompng($img);

0 commit comments

Comments
 (0)