Skip to content

Commit

Permalink
Merge branch 'release/v0.15.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Dec 12, 2019
2 parents 1c75855 + 6355167 commit e1e1e8d
Show file tree
Hide file tree
Showing 27 changed files with 330 additions and 224 deletions.
19 changes: 0 additions & 19 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,6 @@
"contributions": [
"design"
]
},
{
"login": "nlnlnull",
"name": "null",
"avatar_url": "https://avatars3.githubusercontent.com/u/17818831?v=4",
"profile": "https://github.com/nlnlnull",
"contributions": [
"code"
]
},
{
"login": "L1cardo",
"name": "Licardo",
"avatar_url": "https://avatars1.githubusercontent.com/u/33802186?v=4",
"profile": "https://licardo.cn",
"contributions": [
"code",
"design"
]
}
],
"contributorsPerLine": 7
Expand Down
39 changes: 23 additions & 16 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<img src="https://img.shields.io/github/downloads/gee1k/uPic/total.svg?style=flat-square" alt="">
</a>
<a href="https://github.com/gee1k/uPic/blob/master/LICENSE">
<img alt="GitHub" src="https://img.shields.io/github/license/gee1k/uPic?style=flat-square">
<img alt="GitHub" src="https://img.shields.io/github/license/gee1k/uPic?style=flat-square">
</a>
<a href="https://travis-ci.org/gee1k/uPic" style="margin: 0 5px;">
<img src="https://img.shields.io/travis/gee1k/uPic.svg?style=flat-square">
</a>
<a href="https://travis-ci.org/gee1k/uPic" style="margin: 0 5px;">
<img src="https://img.shields.io/travis/gee1k/uPic.svg?style=flat-square">
Expand Down Expand Up @@ -136,18 +139,6 @@ brew cask install upic
</details>



## 💌 联系我

- `Email`: svend.jin@gmail.com
- `Telegram`: [gee1k](https://t.me/gee1k)
- `项目地址`: [Github](https://github.com/gee1k/uPic)
- `uPic 产品交流群(Telegram)`: [点击加入 TG 群](https://t.me/upic_host)
- `微信群`: <small>扫描下方二维码加好友拉你入群 ↓ </small>

<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">


## ❤️ 赞助

如果你喜欢 uPic ,欢迎给我打赏
Expand All @@ -156,9 +147,16 @@ brew cask install upic
| :-: | :-: | :-: |
| [@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) |


## ✨ Contributors

### Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/gee1k/uPic/graphs/contributors"><img src="https://opencollective.com/uPic/contributors.svg?width=890&button=true" /></a>


### Other Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
Expand All @@ -170,12 +168,21 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<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>
<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>
<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>
<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>
<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>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->


## 💌 作者

**uPic** © [Svend](https://github.com/gee1k), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by Svend with help from contributors ([list](https://github.com/gee1k/uPic/contributors)).

> 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)
>
> 微信群 <small>扫描下方二维码加好友拉你入群 ↓ </small>
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,6 @@ brew cask install upic
<p><code>sudo xattr -d com.apple.quarantine /Applications/uPic.app</code> </p>
</details>

## 💌 Contact information

- `Email`: svend.jin@gmail.com
- `Telegram`: [gee1k](https://t.me/gee1k)
- `Github`: [Github](https://github.com/gee1k/uPic)
- `uPic chat group(Telegram)`: [click here to join in](https://t.me/upic_host)
- `Wechat group`: <small>scan the QR code below to join in ↓ </small>

<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">


## ❤️ Support

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

## ✨ Contributors

### Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/gee1k/uPic/graphs/contributors"><img src="https://opencollective.com/uPic/contributors.svg?width=890&button=true" /></a>


### Other Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
Expand All @@ -169,11 +166,20 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<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>
<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>
<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>
<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>
<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>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

## 💌 Auther

**uPic** © [Svend](https://github.com/gee1k), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by Svend with help from contributors ([list](https://github.com/gee1k/uPic/contributors)).

> 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)
>
> Wechat group <small>scan the QR code below to join in ↓ </small>
<img src="https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG" height="200">
12 changes: 8 additions & 4 deletions uPic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
16A6DC5822AA375700813706 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16A6DC5722AA375700813706 /* AppDelegate.swift */; };
16BDDDFF22EA96AE0080E467 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16BDDDFE22EA96AE0080E467 /* Assets.xcassets */; };
16BDDE0322EAA2920080E467 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16BDDE0222EAA2920080E467 /* Assets.xcassets */; };
16C176F523A208A80089B933 /* NSImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C176F423A208A80089B933 /* NSImage+Extension.swift */; };
16D20B5523838AB1006D8D01 /* BaiduRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B54238388D8006D8D01 /* BaiduRegion.swift */; };
16D20B5623838AB5006D8D01 /* BaiduHostConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B532383889F006D8D01 /* BaiduHostConfig.swift */; };
16D20B58238390F2006D8D01 /* BaiduUploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B57238390F2006D8D01 /* BaiduUploader.swift */; };
Expand Down Expand Up @@ -246,6 +247,7 @@
16A6DC6122AA375800813706 /* uPic.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = uPic.entitlements; sourceTree = "<group>"; };
16BDDDFE22EA96AE0080E467 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
16BDDE0222EAA2920080E467 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
16C176F423A208A80089B933 /* NSImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Extension.swift"; sourceTree = "<group>"; };
16D20B532383889F006D8D01 /* BaiduHostConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduHostConfig.swift; sourceTree = "<group>"; };
16D20B54238388D8006D8D01 /* BaiduRegion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduRegion.swift; sourceTree = "<group>"; };
16D20B57238390F2006D8D01 /* BaiduUploader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduUploader.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -335,6 +337,7 @@
165D908522C333740096FF38 /* PasteboardType+Extension.swift */,
165701A022C8A6E600C57EE9 /* Regex.swift */,
1685AA3422DEC943008FBF1D /* FlippedView.swift */,
16C176F423A208A80089B933 /* NSImage+Extension.swift */,
);
path = Basic;
sourceTree = "<group>";
Expand Down Expand Up @@ -883,6 +886,7 @@
1660FCBB22C11C7200372950 /* TencentUploader.swift in Sources */,
167D08AE22ED8A58000F3BC0 /* AliyunUploader.swift in Sources */,
1647474522B66E3400F9575D /* Util.swift in Sources */,
16C176F523A208A80089B933 /* NSImage+Extension.swift in Sources */,
167620ED230819C0008F8363 /* ImgurHostConfig.swift in Sources */,
1657019F22C897A400C57EE9 /* WeiboConfigView.swift in Sources */,
4BC11BDE238CFD53001641A6 /* HistoryThumbnailTimer.swift in Sources */,
Expand Down Expand Up @@ -1113,7 +1117,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20191206;
CURRENT_PROJECT_VERSION = 20191212;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1122,7 +1126,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.15.0;
MARKETING_VERSION = 0.15.1;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1143,7 +1147,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20191206;
CURRENT_PROJECT_VERSION = 20191212;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1152,7 +1156,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.15.0;
MARKETING_VERSION = 0.15.1;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion uPic.xcodeproj/xcshareddata/xcschemes/uPic.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
38 changes: 38 additions & 0 deletions uPic/Basic/NSImage+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// NSImage+Extension.swift
// uPic
//
// Created by Svend Jin on 2019/12/12.
// Copyright © 2019 Svend Jin. All rights reserved.
//

import Cocoa

extension NSImage {
var pngData: Data? {
guard let rep = NSBitmapImageRep(
bitmapDataPlanes: nil,
pixelsWide: Int(size.width),
pixelsHigh: Int(size.height),
bitsPerSample: 8,
samplesPerPixel: 4,
hasAlpha: true,
isPlanar: false,
colorSpaceName: NSColorSpaceName.deviceRGB,
bytesPerRow: 0,
bitsPerPixel: 0
) else {
print("Couldn't create bitmap representation")
return nil
}
NSGraphicsContext.saveGraphicsState()
NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)
draw(at: NSZeroPoint, from: NSZeroRect, operation: .sourceOver, fraction: 1.0)
NSGraphicsContext.restoreGraphicsState()
guard let data = rep.representation(using: NSBitmapImageRep.FileType.png, properties: [NSBitmapImageRep.PropertyKey.compressionFactor: 1.0]) else {
print("Couldn't create PNG")
return nil
}
return data
}
}
12 changes: 6 additions & 6 deletions uPic/Models/Aliyun/AliyunUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class AliyunUploader: BaseUploader {
static let shared = AliyunUploader()
static let fileExtensions: [String] = []

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

}

func upload(_ fileUrl: URL) {
self._upload(fileUrl, fileData: nil)
func upload(_ fileUrl: URL, host: Host) {
self._upload(fileUrl, fileData: nil, host: host)
}

func upload(_ fileData: Data) {
self._upload(nil, fileData: fileData)
func upload(_ fileData: Data, host: Host) {
self._upload(nil, fileData: fileData, host: host)
}
}
16 changes: 8 additions & 8 deletions uPic/Models/Amazon_S3/AmazonS3Uploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class AmazonS3Uploader: BaseUploader {
static let shared = AmazonS3Uploader()
static let fileExtensions: [String] = []

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

}

func upload(_ fileUrl: URL) {
self._upload(fileUrl, fileData: nil)
func upload(_ fileUrl: URL, host: Host) {
self._upload(fileUrl, fileData: nil, host: host)
}

func upload(_ fileData: Data) {
self._upload(nil, fileData: fileData)
func upload(_ fileData: Data, host: Host) {
self._upload(nil, fileData: fileData, host: host)
}
}
12 changes: 6 additions & 6 deletions uPic/Models/Baidu/BaiduUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class BaiduUploader: BaseUploader {
static let shared = BaiduUploader()
static let fileExtensions: [String] = []

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

}

func upload(_ fileUrl: URL) {
self._upload(fileUrl, fileData: nil)
func upload(_ fileUrl: URL, host: Host) {
self._upload(fileUrl, fileData: nil, host: host)
}

func upload(_ fileData: Data) {
self._upload(nil, fileData: fileData)
func upload(_ fileData: Data, host: Host) {
self._upload(nil, fileData: fileData, host: host)
}
}
Loading

0 comments on commit e1e1e8d

Please sign in to comment.