Skip to content

Commit

Permalink
Merge branch 'release/v0.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Nov 19, 2019
2 parents 174c287 + 9862c5c commit e6b8ec4
Show file tree
Hide file tree
Showing 23 changed files with 635 additions and 63 deletions.
3 changes: 2 additions & 1 deletion README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
**💡 特点:** 无论是本地文件、或者屏幕截图都可自动上传,菜单栏显示实时上传进度。上传完成后文件链接自动复制到剪切板,让你无论是在写博客、灌水聊天都能快速插入图片。
连接格式可以是普通 URL、HTML 或者 Markdown,仍由你掌控。

**🔋 支持图床:** [smms](https://sm.ms/)[又拍云 USS](https://www.upyun.com/products/file-storage)[七牛云 KODO](https://www.qiniu.com/products/kodo)[阿里云 OSS](https://www.aliyun.com/product/oss/)[腾讯云 COS](https://cloud.tencent.com/product/cos)[微博](https://weibo.com/)[Github](https://github.com/settings/tokens)[Gitee](https://gitee.com/profile/personal_access_tokens)[Amazon S3](https://aws.amazon.com/cn/s3/)[Imgur](https://imgur.com/)[自定义上传接口](https://blog.svend.cc/upic/tutorials/custom)、...
**🔋 支持图床:** [smms](https://sm.ms/)[又拍云 USS](https://www.upyun.com/products/file-storage)[七牛云 KODO](https://www.qiniu.com/products/kodo)[阿里云 OSS](https://www.aliyun.com/product/oss/)[腾讯云 COS](https://cloud.tencent.com/product/cos) [百度云 BOS](https://cloud.baidu.com/product/bos.html)[微博](https://weibo.com/)[Github](https://github.com/settings/tokens)[Gitee](https://gitee.com/profile/personal_access_tokens)[Amazon S3](https://aws.amazon.com/cn/s3/)[Imgur](https://imgur.com/)[自定义上传接口](https://blog.svend.cc/upic/tutorials/custom)、...

## 🚀 如何安装

Expand Down Expand Up @@ -101,6 +101,7 @@ brew cask install upic
<li><a href="https://blog.svend.cc/upic/tutorials/qiniu_kodo" target="_blank">uPic 图床配置教程 - 七牛云</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/aliyun_oss" target="_blank">uPic 图床配置教程 - 阿里云</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/tencent_cos" target="_blank">uPic 图床配置教程 - 腾讯云</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/baidu_bos" target="_blank">uPic 图床配置教程 - 百度云</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/amazon_s3" target="_blank">uPic 图床配置教程 - Amazon S3</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/imgur" target="_blank">uPic 图床配置教程 - Imgur</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/github" target="_blank">uPic 图床配置教程 - Github</a></li>
Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@
## 📑 Introduction

> **uPic(upload Picture) is a image(file) hosting client for Mac.**
> You can upload images、files to specified provider’s OSD service which was configured.
> You can upload image, files to specified provider’s OSD service which was configured.
> Before uploading, you can get an url immediately which can be accessed on internet.


**💡 Tips:** They can automatic uploading local file and screenshot,meanwhile the menu bar shows the uploading progress constantly.File's link will automatically copied to the clipboard when finish upload,make you insert pictures quickly when you are blogging or chatting.Link’s format can be a normal URL,HTML or Markdown,it's totally up to you.
**💡 Tips:** They can automatic uploading local file and screenshot, meanwhile the menu bar shows the uploading progress constantly. File's link will automatically copied to the clipboard when finish upload, make you insert pictures quickly when you are blogging or chatting. Link’s format can be a normal URL, HTML or Markdown, it's totally up to you.

**🔋 Support image hosting:**[smms](https://sm.ms/) [UPYUN USS](https://www.upyun.com/products/file-storage)[qiniu KODO](https://www.qiniu.com/products/kodo) [Aliyun OSS](https://www.aliyun.com/product/oss/) [TencentCloud COS](https://cloud.tencent.com/product/cos)[Weibo](https://weibo.com/)[Github](https://github.com/settings/tokens) [Gitee](https://gitee.com/profile/personal_access_tokens) [Amazon S3](https://aws.amazon.com/cn/s3/)[Imgur](https://imgur.com/)[custom upload api](https://blog.svend.cc/upic/tutorials/custom)...
**🔋 Support image hosting:**[smms](https://sm.ms/), [UPYUN USS](https://www.upyun.com/products/file-storage), [qiniu KODO](https://www.qiniu.com/products/kodo), [Aliyun OSS](https://www.aliyun.com/product/oss/), [TencentCloud COS](https://cloud.tencent.com/product/cos), [BaiduCloud BOS](https://cloud.baidu.com/product/bos.html), [Weibo](https://weibo.com/), [Github](https://github.com/settings/tokens), [Gitee](https://gitee.com/profile/personal_access_tokens), [Amazon S3](https://aws.amazon.com/cn/s3/), [Imgur](https://imgur.com/), [custom upload api](https://blog.svend.cc/upic/tutorials/custom), ...

## 🚀 How to install


### 1.Homebrew(Recommend):
### 1. Homebrew(Recommend):
```
brew cask install upic
```
### 2.Download from github
click [release](https://github.com/gee1k/uPic/releases) to download.
### 2. Download from github
Click [release](https://github.com/gee1k/uPic/releases) to download.
**If accessing Github is difficult to download, you can download it from [Gitee release](https://gitee.com/gee1k/uPic/releases).**

### Check Finder Extensions's authority

- 1.Run uPic
- 1. Run uPic

- 2.Open`system preference` - `extensions` - `Finder Extensions` make sure that `uPicFinderExtension` is be selected
- 2. Open `System preferences` - `Extensions` - `Finder Extensions` make sure that `uPicFinderExtension` is be selected

<center>
<img src="https://raw.githubusercontent.com/gee1k/oss/master/screenshot/uPic/en-finder-extension.png" height="300">
Expand All @@ -68,7 +68,7 @@ brew cask install upic

## 🧰 More Functions

**Except these basic functions,uPic also provides a series of small features to improve user experience.**
**Except these basic functions, uPic also provides a series of small features to improve user experience.**

<details><summary>1. ⌨︎ Global shortcut key</summary><br>
<p>
Expand Down Expand Up @@ -102,6 +102,7 @@ brew cask install upic
<li><a href="https://blog.svend.cc/upic/tutorials/qiniu_kodo/en" target="_blank">uPic configuration - Qiniu</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/aliyun_oss/en" target="_blank">uPic configuration - Aliyun</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/tencent_cos/en" target="_blank">uPic configuration - Tencent Cloud</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/baidu_bos/en" target="_blank">uPic configuration - Baidu Cloud</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/amazon_s3/en" target="_blank">uPic configuration - Amazon S3</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/imgur/en" target="_blank">uPic configuration - Imgur</a></li>
<li><a href="https://blog.svend.cc/upic/tutorials/github/en" target="_blank">uPic configuration - Github</a></li>
Expand All @@ -110,19 +111,19 @@ brew cask install upic
</ul>
</details>
<details><summary>2. Finder extension doesn't work❓</summary><br>
<p>Because of Finder extension will always be selected after select action was done.So if you come across Finder extension operation is unresponsive,maybe uPic program was not runing.</p>
<p>Because of Finder extension will always be selected after select action was done. So if you come across Finder extension operation is unresponsive, maybe uPic program was not runing.</p>
</details>
<details>
<summary>3.Why I finished configuration of image hosting already,image/file upload failed?</summary>
<summary>3.Why I finished configuration of image hosting already, image/file upload failed?</summary>
<div>
<p>maybe you choose the wrong image hosting,go to check it out~</p>
<p>maybe you choose the wrong image hosting, go to check it out~</p>
<img src="https://raw.githubusercontent.com/gee1k/oss/master/screenshot/uPic/en-default-host.png" width="450">
</div>
</details>
<details>
<summary>4. Upload completed without notification❓</summary><br>
<p><strong>For example, when the v0.10.4 version is changed, the notification method has changed, and the user may not receive the notification after the upload is completed. Can be solved by the following methods</strong></p>
<p>1.In the <code>system preferences</code> - <code>Notifications</code>, find <code>uPic</code> in the list and delete (press the Delete key)</p>
<p>1.In the <code>System preferences</code> - <code>Notifications</code>, find <code>uPic</code> in the list and delete (press the Delete key)</p>
<p>2.Exit uPic and restart</p>
<img src="https://raw.githubusercontent.com/gee1k/oss/master/screenshot/uPic/delete-notification.png" width="450">
</details>
Expand All @@ -145,7 +146,7 @@ brew cask install upic

## ❤️ Support

If you like uPic,please hit the star button and thanks for your support.
If you like uPic, please hit the star button and thanks for your support.

| **Paypal** | **Alipay** | **Wechat** |
| :-: | :-: | :-: |
Expand All @@ -170,4 +171,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
38 changes: 33 additions & 5 deletions uPic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
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 */; };
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 */; };
16D20B5A238390F4006D8D01 /* BaiduUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B59238390F4006D8D01 /* BaiduUtil.swift */; };
16D20B5C238392C9006D8D01 /* BaiduConfigView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D20B5B238392C9006D8D01 /* BaiduConfigView.swift */; };
16EA204C22AF8AB30006FB9C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EA204B22AF8AB30006FB9C /* AppDelegate.swift */; };
16EA205022AF8AB40006FB9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 16EA204F22AF8AB40006FB9C /* Assets.xcassets */; };
16EA205322AF8AB40006FB9C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 16EA205122AF8AB40006FB9C /* Main.storyboard */; };
Expand Down Expand Up @@ -232,6 +237,11 @@
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>"; };
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>"; };
16D20B59238390F4006D8D01 /* BaiduUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduUtil.swift; sourceTree = "<group>"; };
16D20B5B238392C9006D8D01 /* BaiduConfigView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaiduConfigView.swift; sourceTree = "<group>"; };
16EA204922AF8AB30006FB9C /* uPicHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = uPicHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
16EA204B22AF8AB30006FB9C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
16EA204F22AF8AB40006FB9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -366,6 +376,7 @@
1646B80F22C7C485009271DF /* Views */ = {
isa = PBXGroup;
children = (
16D20B5B238392C9006D8D01 /* BaiduConfigView.swift */,
167620EF23081DC0008F8363 /* ImgurConfigView.swift */,
167D08A622ED88C2000F3BC0 /* AmazonS3ConfigView.swift */,
1657019E22C897A400C57EE9 /* WeiboConfigView.swift */,
Expand Down Expand Up @@ -427,7 +438,6 @@
1672762122AFF63A007299C3 /* Models */ = {
isa = PBXGroup;
children = (
167620EA2308191A008F8363 /* Imgur */,
1602ED9622ADEFB200AA8638 /* BaseUploader.swift */,
1675EC5222FB38240038DA33 /* BaseUploaderUtil.swift */,
1672762222AFF655007299C3 /* Host.swift */,
Expand All @@ -436,9 +446,11 @@
167D7F4A22B4D31300DD0A7A /* HostType.swift */,
68BBB87F2C3AEBDF2C914131 /* Aliyun */,
167D08A522ED8132000F3BC0 /* Amazon_S3 */,
16D20B522383887E006D8D01 /* Baidu */,
161C3BDF22C4830A0092114F /* Custom */,
1646B80222C7931E009271DF /* Gitee */,
167DDBE922C76F3B00B03357 /* Github */,
167620EA2308191A008F8363 /* Imgur */,
1690E7E522BF113700FC81F8 /* Qiniu */,
167D7F4E22B4DB2500DD0A7A /* Smms */,
1660FCB522C11A9F00372950 /* Tencent */,
Expand Down Expand Up @@ -568,6 +580,17 @@
path = Views;
sourceTree = "<group>";
};
16D20B522383887E006D8D01 /* Baidu */ = {
isa = PBXGroup;
children = (
16D20B54238388D8006D8D01 /* BaiduRegion.swift */,
16D20B57238390F2006D8D01 /* BaiduUploader.swift */,
16D20B532383889F006D8D01 /* BaiduHostConfig.swift */,
16D20B59238390F4006D8D01 /* BaiduUtil.swift */,
);
path = Baidu;
sourceTree = "<group>";
};
16EA204A22AF8AB30006FB9C /* uPicHelper */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -832,6 +855,7 @@
167D08AC22ED8A4B000F3BC0 /* AliyunRegion.swift in Sources */,
1685AA3522DEC943008FBF1D /* FlippedView.swift in Sources */,
16068C7822AECB34004D39B7 /* PreferencesWindowController.swift in Sources */,
16D20B58238390F2006D8D01 /* BaiduUploader.swift in Sources */,
1675EC5322FB38240038DA33 /* BaseUploaderUtil.swift in Sources */,
16995A3422B6008000B1F923 /* UpYunHostConfig.swift in Sources */,
1672762322AFF655007299C3 /* Host.swift in Sources */,
Expand All @@ -840,11 +864,14 @@
164745F022B65FE900F9575D /* String+Extension.swift in Sources */,
166B4A5322B9CB4D001288ED /* UpYunConfigView.swift in Sources */,
166B4A5722B9D118001288ED /* PreferencesNotifier.swift in Sources */,
16D20B5523838AB1006D8D01 /* BaiduRegion.swift in Sources */,
1646B80E22C7C082009271DF /* ConfigView.swift in Sources */,
16D20B5A238390F4006D8D01 /* BaiduUtil.swift in Sources */,
1690E7EB22BF2D9400FC81F8 /* QiniuUploader.swift in Sources */,
1657019B22C8934000C57EE9 /* WeiboqQuality.swift in Sources */,
165D908622C333740096FF38 /* PasteboardType+Extension.swift in Sources */,
16A6DC5822AA375700813706 /* AppDelegate.swift in Sources */,
16D20B5623838AB5006D8D01 /* BaiduHostConfig.swift in Sources */,
1602ED9722ADEFB200AA8638 /* BaseUploader.swift in Sources */,
163632F322B2751D00805E7F /* BoolType.swift in Sources */,
1646B80722C79346009271DF /* GiteeHostConfig.swift in Sources */,
Expand Down Expand Up @@ -907,6 +934,7 @@
1660FCBA22C11C2300372950 /* TencentHostConfig.swift in Sources */,
16248E32230673B6002131BB /* NotificationExt.swift in Sources */,
167DDBEF22C7722200B03357 /* GithubUtil.swift in Sources */,
16D20B5C238392C9006D8D01 /* BaiduConfigView.swift in Sources */,
167620F023081DC0008F8363 /* ImgurConfigView.swift in Sources */,
1685AA3722DEEE6C008FBF1D /* CustomHostUtil.swift in Sources */,
68BBB99780D7F4586458D4F5 /* AmazonS3Util.swift in Sources */,
Expand Down Expand Up @@ -1119,7 +1147,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20191031;
CURRENT_PROJECT_VERSION = 20191119;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1128,7 +1156,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.12.4;
MARKETING_VERSION = 0.13.0;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1149,7 +1177,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20191031;
CURRENT_PROJECT_VERSION = 20191119;
DEVELOPMENT_TEAM = W863J6W8DZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist";
Expand All @@ -1158,7 +1186,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MARKETING_VERSION = 0.12.4;
MARKETING_VERSION = 0.13.0;
PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
21 changes: 21 additions & 0 deletions uPic/Assets.xcassets/host_icon_11.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "baidu.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions uPic/Basic/Date+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ extension Date {
return formatter.string(from: self)
}

func toISOString() -> String {
return Date.ISOStringFromDate(date: self)
func toISOString(dateFormat: String? = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") -> String {
return Date.ISOStringFromDate(date: self, dateFormat: dateFormat)
}

static func ISOStringFromDate(date: Date) -> String {
static func ISOStringFromDate(date: Date, dateFormat: String? = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") -> String {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"
dateFormatter.dateFormat = dateFormat

return dateFormatter.string(from: date).appending("Z")
return dateFormatter.string(from: date)
}

static func dateFromISOString(string: String) -> Date? {
static func dateFromISOString(string: String, dateFormat: String? = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") -> Date? {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.timeZone = TimeZone.autoupdatingCurrent
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
dateFormatter.dateFormat = dateFormat

return dateFormatter.date(from: string)
}
Expand Down
5 changes: 5 additions & 0 deletions uPic/Basic/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ extension String {
let hmac = try! HMAC(key: key, variant: .sha256).authenticate(self.toBytes())
return hmac
}

func calculateHMAC256ByKey(key: String) -> Array<UInt8> {
let hmac = try! HMAC(key: key.toBytes(), variant: .sha256).authenticate(self.toBytes())
return hmac
}

func urlSafeBase64() -> String {
return self.replacingOccurrences(of: "+", with: "-").replacingOccurrences(of: "/", with: "_")
Expand Down
Loading

0 comments on commit e6b8ec4

Please sign in to comment.