Skip to content

Commit e1e1e8d

Browse files
committed
Merge branch 'release/v0.15.1'
2 parents 1c75855 + 6355167 commit e1e1e8d

27 files changed

+330
-224
lines changed

.all-contributorsrc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,6 @@
4646
"contributions": [
4747
"design"
4848
]
49-
},
50-
{
51-
"login": "nlnlnull",
52-
"name": "null",
53-
"avatar_url": "https://avatars3.githubusercontent.com/u/17818831?v=4",
54-
"profile": "https://github.com/nlnlnull",
55-
"contributions": [
56-
"code"
57-
]
58-
},
59-
{
60-
"login": "L1cardo",
61-
"name": "Licardo",
62-
"avatar_url": "https://avatars1.githubusercontent.com/u/33802186?v=4",
63-
"profile": "https://licardo.cn",
64-
"contributions": [
65-
"code",
66-
"design"
67-
]
6849
}
6950
],
7051
"contributorsPerLine": 7

README-cn.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<img src="https://img.shields.io/github/downloads/gee1k/uPic/total.svg?style=flat-square" alt="">
1414
</a>
1515
<a href="https://github.com/gee1k/uPic/blob/master/LICENSE">
16-
<img alt="GitHub" src="https://img.shields.io/github/license/gee1k/uPic?style=flat-square">
16+
<img alt="GitHub" src="https://img.shields.io/github/license/gee1k/uPic?style=flat-square">
17+
</a>
18+
<a href="https://travis-ci.org/gee1k/uPic" style="margin: 0 5px;">
19+
<img src="https://img.shields.io/travis/gee1k/uPic.svg?style=flat-square">
1720
</a>
1821
<a href="https://travis-ci.org/gee1k/uPic" style="margin: 0 5px;">
1922
<img src="https://img.shields.io/travis/gee1k/uPic.svg?style=flat-square">
@@ -136,18 +139,6 @@ brew cask install upic
136139
</details>
137140

138141

139-
140-
## 💌 联系我
141-
142-
- `Email`: svend.jin@gmail.com
143-
- `Telegram`: [gee1k](https://t.me/gee1k)
144-
- `项目地址`: [Github](https://github.com/gee1k/uPic)
145-
- `uPic 产品交流群(Telegram)`: [点击加入 TG 群](https://t.me/upic_host)
146-
- `微信群`: <small>扫描下方二维码加好友拉你入群 ↓ </small>
147-
148-
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">
149-
150-
151142
## ❤️ 赞助
152143

153144
如果你喜欢 uPic ,欢迎给我打赏
@@ -156,9 +147,16 @@ brew cask install upic
156147
| :-: | :-: | :-: |
157148
| [@Geee1k](https://paypal.me/geee1k) | ![](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/alipay-mini.jpeg) | ![](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/wechat-zs.JPG) |
158149

159-
160150
## ✨ Contributors
161151

152+
### Code Contributors
153+
154+
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
155+
<a href="https://github.com/gee1k/uPic/graphs/contributors"><img src="https://opencollective.com/uPic/contributors.svg?width=890&button=true" /></a>
156+
157+
158+
### Other Contributors
159+
162160
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
163161

164162
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
@@ -170,12 +168,21 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
170168
<td align="center"><a href="https://github.com/Jackxun123"><img src="https://avatars2.githubusercontent.com/u/33611532?v=4" width="100px;" alt="Jackxun123"/><br /><sub><b>Jackxun123</b></sub></a><br /><a href="#translation-Jackxun123" title="Translation">🌍</a></td>
171169
<td align="center"><a href="https://github.com/kkkkkkyrie"><img src="https://avatars2.githubusercontent.com/u/30786071?v=4" width="100px;" alt="eleven"/><br /><sub><b>eleven</b></sub></a><br /><a href="#translation-kkkkkkyrie" title="Translation">🌍</a></td>
172170
<td align="center"><a href="https://immx.io/"><img src="https://avatars1.githubusercontent.com/u/16921591?v=4" width="100px;" alt="zhucebuliaomax"/><br /><sub><b>zhucebuliaomax</b></sub></a><br /><a href="#design-ihatework" title="Design">🎨</a></td>
173-
<td align="center"><a href="https://github.com/nlnlnull"><img src="https://avatars3.githubusercontent.com/u/17818831?v=4" width="100px;" alt="null"/><br /><sub><b>null</b></sub></a><br /><a href="https://github.com/gee1k/uPic/commits?author=nlnlnull" title="Code">💻</a></td>
174-
<td align="center"><a href="https://licardo.cn"><img src="https://avatars1.githubusercontent.com/u/33802186?v=4" width="100px;" alt="Licardo"/><br /><sub><b>Licardo</b></sub></a><br /><a href="https://github.com/gee1k/uPic/commits?author=L1cardo" title="Code">💻</a> <a href="#design-L1cardo" title="Design">🎨</a></td>
175171
</tr>
176172
</table>
177173

178174
<!-- markdownlint-enable -->
179175
<!-- prettier-ignore-end -->
180176
<!-- ALL-CONTRIBUTORS-LIST:END -->
181177

178+
179+
## 💌 作者
180+
181+
**uPic** © [Svend](https://github.com/gee1k), Released under the [MIT](./LICENSE) License.<br>
182+
Authored and maintained by Svend with help from contributors ([list](https://github.com/gee1k/uPic/contributors)).
183+
184+
> Blog [@Svend](https://svend.cc) · GitHub [@gee1k](https://github.com/gee1k) · Twitter [@geee1k](https://twitter.com/geee1k) · Telegram Channel [@uPic 产品交流群](https://t.me/upic_host)
185+
>
186+
> 微信群 <small>扫描下方二维码加好友拉你入群 ↓ </small>
187+
188+
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,6 @@ brew cask install upic
136136
<p><code>sudo xattr -d com.apple.quarantine /Applications/uPic.app</code> </p>
137137
</details>
138138

139-
## 💌 Contact information
140-
141-
- `Email`: svend.jin@gmail.com
142-
- `Telegram`: [gee1k](https://t.me/gee1k)
143-
- `Github`: [Github](https://github.com/gee1k/uPic)
144-
- `uPic chat group(Telegram)`: [click here to join in](https://t.me/upic_host)
145-
- `Wechat group`: <small>scan the QR code below to join in ↓ </small>
146-
147-
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">
148-
149-
150139
## ❤️ Support
151140

152141
If you like uPic, please hit the star button and thanks for your support.
@@ -158,6 +147,14 @@ If you like uPic, please hit the star button and thanks for your support.
158147

159148
## ✨ Contributors
160149

150+
### Code Contributors
151+
152+
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
153+
<a href="https://github.com/gee1k/uPic/graphs/contributors"><img src="https://opencollective.com/uPic/contributors.svg?width=890&button=true" /></a>
154+
155+
156+
### Other Contributors
157+
161158
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
162159

163160
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
@@ -169,11 +166,20 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
169166
<td align="center"><a href="https://github.com/Jackxun123"><img src="https://avatars2.githubusercontent.com/u/33611532?v=4" width="100px;" alt="Jackxun123"/><br /><sub><b>Jackxun123</b></sub></a><br /><a href="#translation-Jackxun123" title="Translation">🌍</a></td>
170167
<td align="center"><a href="https://github.com/kkkkkkyrie"><img src="https://avatars2.githubusercontent.com/u/30786071?v=4" width="100px;" alt="eleven"/><br /><sub><b>eleven</b></sub></a><br /><a href="#translation-kkkkkkyrie" title="Translation">🌍</a></td>
171168
<td align="center"><a href="https://immx.io/"><img src="https://avatars1.githubusercontent.com/u/16921591?v=4" width="100px;" alt="zhucebuliaomax"/><br /><sub><b>zhucebuliaomax</b></sub></a><br /><a href="#design-ihatework" title="Design">🎨</a></td>
172-
<td align="center"><a href="https://github.com/nlnlnull"><img src="https://avatars3.githubusercontent.com/u/17818831?v=4" width="100px;" alt="null"/><br /><sub><b>null</b></sub></a><br /><a href="https://github.com/gee1k/uPic/commits?author=nlnlnull" title="Code">💻</a></td>
173-
<td align="center"><a href="https://licardo.cn"><img src="https://avatars1.githubusercontent.com/u/33802186?v=4" width="100px;" alt="Licardo"/><br /><sub><b>Licardo</b></sub></a><br /><a href="https://github.com/gee1k/uPic/commits?author=L1cardo" title="Code">💻</a> <a href="#design-L1cardo" title="Design">🎨</a></td>
174169
</tr>
175170
</table>
176171

177172
<!-- markdownlint-enable -->
178173
<!-- prettier-ignore-end -->
179174
<!-- ALL-CONTRIBUTORS-LIST:END -->
175+
176+
## 💌 Auther
177+
178+
**uPic** © [Svend](https://github.com/gee1k), Released under the [MIT](./LICENSE) License.<br>
179+
Authored and maintained by Svend with help from contributors ([list](https://github.com/gee1k/uPic/contributors)).
180+
181+
> Blog [@Svend](https://svend.cc) · GitHub [@gee1k](https://github.com/gee1k) · Twitter [@geee1k](https://twitter.com/geee1k) · Telegram Channel [@uPic 产品交流群](https://t.me/upic_host)
182+
>
183+
> Wechat group <small>scan the QR code below to join in ↓ </small>
184+
185+
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">

uPic.xcodeproj/project.pbxproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
16A6DC5822AA375700813706 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16A6DC5722AA375700813706 /* AppDelegate.swift */; };
9595
16BDDDFF22EA96AE0080E467 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16BDDDFE22EA96AE0080E467 /* Assets.xcassets */; };
9696
16BDDE0322EAA2920080E467 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16BDDE0222EAA2920080E467 /* Assets.xcassets */; };
97+
16C176F523A208A80089B933 /* NSImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C176F423A208A80089B933 /* NSImage+Extension.swift */; };
9798
16D20B5523838AB1006D8D01 /* BaiduRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B54238388D8006D8D01 /* BaiduRegion.swift */; };
9899
16D20B5623838AB5006D8D01 /* BaiduHostConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B532383889F006D8D01 /* BaiduHostConfig.swift */; };
99100
16D20B58238390F2006D8D01 /* BaiduUploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B57238390F2006D8D01 /* BaiduUploader.swift */; };
@@ -246,6 +247,7 @@
246247
16A6DC6122AA375800813706 /* uPic.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = uPic.entitlements; sourceTree = "<group>"; };
247248
16BDDDFE22EA96AE0080E467 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
248249
16BDDE0222EAA2920080E467 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
250+
16C176F423A208A80089B933 /* NSImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Extension.swift"; sourceTree = "<group>"; };
249251
16D20B532383889F006D8D01 /* BaiduHostConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduHostConfig.swift; sourceTree = "<group>"; };
250252
16D20B54238388D8006D8D01 /* BaiduRegion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduRegion.swift; sourceTree = "<group>"; };
251253
16D20B57238390F2006D8D01 /* BaiduUploader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduUploader.swift; sourceTree = "<group>"; };
@@ -335,6 +337,7 @@
335337
165D908522C333740096FF38 /* PasteboardType+Extension.swift */,
336338
165701A022C8A6E600C57EE9 /* Regex.swift */,
337339
1685AA3422DEC943008FBF1D /* FlippedView.swift */,
340+
16C176F423A208A80089B933 /* NSImage+Extension.swift */,
338341
);
339342
path = Basic;
340343
sourceTree = "<group>";
@@ -883,6 +886,7 @@
883886
1660FCBB22C11C7200372950 /* TencentUploader.swift in Sources */,
884887
167D08AE22ED8A58000F3BC0 /* AliyunUploader.swift in Sources */,
885888
1647474522B66E3400F9575D /* Util.swift in Sources */,
889+
16C176F523A208A80089B933 /* NSImage+Extension.swift in Sources */,
886890
167620ED230819C0008F8363 /* ImgurHostConfig.swift in Sources */,
887891
1657019F22C897A400C57EE9 /* WeiboConfigView.swift in Sources */,
888892
4BC11BDE238CFD53001641A6 /* HistoryThumbnailTimer.swift in Sources */,
@@ -1113,7 +1117,7 @@
11131117
CODE_SIGN_IDENTITY = "Apple Development";
11141118
CODE_SIGN_STYLE = Manual;
11151119
COMBINE_HIDPI_IMAGES = YES;
1116-
CURRENT_PROJECT_VERSION = 20191206;
1120+
CURRENT_PROJECT_VERSION = 20191212;
11171121
DEVELOPMENT_TEAM = W863J6W8DZ;
11181122
ENABLE_HARDENED_RUNTIME = YES;
11191123
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
@@ -1122,7 +1126,7 @@
11221126
"@executable_path/../Frameworks",
11231127
);
11241128
MACOSX_DEPLOYMENT_TARGET = 10.12;
1125-
MARKETING_VERSION = 0.15.0;
1129+
MARKETING_VERSION = 0.15.1;
11261130
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
11271131
PRODUCT_NAME = "$(TARGET_NAME)";
11281132
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1143,7 +1147,7 @@
11431147
CODE_SIGN_IDENTITY = "Apple Development";
11441148
CODE_SIGN_STYLE = Manual;
11451149
COMBINE_HIDPI_IMAGES = YES;
1146-
CURRENT_PROJECT_VERSION = 20191206;
1150+
CURRENT_PROJECT_VERSION = 20191212;
11471151
DEVELOPMENT_TEAM = W863J6W8DZ;
11481152
ENABLE_HARDENED_RUNTIME = YES;
11491153
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
@@ -1152,7 +1156,7 @@
11521156
"@executable_path/../Frameworks",
11531157
);
11541158
MACOSX_DEPLOYMENT_TARGET = 10.12;
1155-
MARKETING_VERSION = 0.15.0;
1159+
MARKETING_VERSION = 0.15.1;
11561160
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
11571161
PRODUCT_NAME = "$(TARGET_NAME)";
11581162
PROVISIONING_PROFILE_SPECIFIER = "";

uPic.xcodeproj/xcshareddata/xcschemes/uPic.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1120"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

uPic/Basic/NSImage+Extension.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// NSImage+Extension.swift
3+
// uPic
4+
//
5+
// Created by Svend Jin on 2019/12/12.
6+
// Copyright © 2019 Svend Jin. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
extension NSImage {
12+
var pngData: Data? {
13+
guard let rep = NSBitmapImageRep(
14+
bitmapDataPlanes: nil,
15+
pixelsWide: Int(size.width),
16+
pixelsHigh: Int(size.height),
17+
bitsPerSample: 8,
18+
samplesPerPixel: 4,
19+
hasAlpha: true,
20+
isPlanar: false,
21+
colorSpaceName: NSColorSpaceName.deviceRGB,
22+
bytesPerRow: 0,
23+
bitsPerPixel: 0
24+
) else {
25+
print("Couldn't create bitmap representation")
26+
return nil
27+
}
28+
NSGraphicsContext.saveGraphicsState()
29+
NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)
30+
draw(at: NSZeroPoint, from: NSZeroRect, operation: .sourceOver, fraction: 1.0)
31+
NSGraphicsContext.restoreGraphicsState()
32+
guard let data = rep.representation(using: NSBitmapImageRep.FileType.png, properties: [NSBitmapImageRep.PropertyKey.compressionFactor: 1.0]) else {
33+
print("Couldn't create PNG")
34+
return nil
35+
}
36+
return data
37+
}
38+
}

uPic/Models/Aliyun/AliyunUploader.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class AliyunUploader: BaseUploader {
1515
static let shared = AliyunUploader()
1616
static let fileExtensions: [String] = []
1717

18-
func _upload(_ fileUrl: URL?, fileData: Data?) {
19-
guard let host = ConfigManager.shared.getDefaultHost(), let data = host.data else {
18+
func _upload(_ fileUrl: URL?, fileData: Data?, host: Host) {
19+
guard let data = host.data else {
2020
super.faild(errorMsg: "There is a problem with the map bed configuration, please check!".localized)
2121
return
2222
}
@@ -101,11 +101,11 @@ class AliyunUploader: BaseUploader {
101101

102102
}
103103

104-
func upload(_ fileUrl: URL) {
105-
self._upload(fileUrl, fileData: nil)
104+
func upload(_ fileUrl: URL, host: Host) {
105+
self._upload(fileUrl, fileData: nil, host: host)
106106
}
107107

108-
func upload(_ fileData: Data) {
109-
self._upload(nil, fileData: fileData)
108+
func upload(_ fileData: Data, host: Host) {
109+
self._upload(nil, fileData: fileData, host: host)
110110
}
111111
}

uPic/Models/Amazon_S3/AmazonS3Uploader.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class AmazonS3Uploader: BaseUploader {
1515
static let shared = AmazonS3Uploader()
1616
static let fileExtensions: [String] = []
1717

18-
func _upload(_ fileUrl: URL?, fileData: Data?) {
19-
guard let host = ConfigManager.shared.getDefaultHost(), let data = host.data else {
18+
func _upload(_ fileUrl: URL?, fileData: Data?, host: Host) {
19+
guard let data = host.data else {
2020
super.faild(errorMsg: "There is a problem with the map bed configuration, please check!".localized)
2121
return
2222
}
@@ -115,12 +115,12 @@ class AmazonS3Uploader: BaseUploader {
115115
})
116116

117117
}
118-
119-
func upload(_ fileUrl: URL) {
120-
self._upload(fileUrl, fileData: nil)
118+
119+
func upload(_ fileUrl: URL, host: Host) {
120+
self._upload(fileUrl, fileData: nil, host: host)
121121
}
122-
123-
func upload(_ fileData: Data) {
124-
self._upload(nil, fileData: fileData)
122+
123+
func upload(_ fileData: Data, host: Host) {
124+
self._upload(nil, fileData: fileData, host: host)
125125
}
126126
}

uPic/Models/Baidu/BaiduUploader.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class BaiduUploader: BaseUploader {
1515
static let shared = BaiduUploader()
1616
static let fileExtensions: [String] = []
1717

18-
func _upload(_ fileUrl: URL?, fileData: Data?) {
19-
guard let host = ConfigManager.shared.getDefaultHost(), let data = host.data else {
18+
func _upload(_ fileUrl: URL?, fileData: Data?, host: Host) {
19+
guard let data = host.data else {
2020
super.faild(errorMsg: "There is a problem with the map bed configuration, please check!".localized)
2121
return
2222
}
@@ -100,11 +100,11 @@ class BaiduUploader: BaseUploader {
100100

101101
}
102102

103-
func upload(_ fileUrl: URL) {
104-
self._upload(fileUrl, fileData: nil)
103+
func upload(_ fileUrl: URL, host: Host) {
104+
self._upload(fileUrl, fileData: nil, host: host)
105105
}
106106

107-
func upload(_ fileData: Data) {
108-
self._upload(nil, fileData: fileData)
107+
func upload(_ fileData: Data, host: Host) {
108+
self._upload(nil, fileData: fileData, host: host)
109109
}
110110
}

0 commit comments

Comments
 (0)