Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
update README
  • Loading branch information
supine0703 committed Aug 2, 2024
1 parent 0d7c562 commit 5d9a5fd
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 13 deletions.
125 changes: 125 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

[中文](./README.md) |-> [English](./README.en.md)


### 🍴 Fork

This is a fork of the [picgo-plugin-compress-webp-lossless](https://github.com/mrgeneralgoo/picgo-plugin-compress-webp-lossless) repository, And it is a fork of the [picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) repository.

# ⚗️ Background

[picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) has been a long time not updated, The key is in ` PicGo ` underlying upload library from ` request ` migrated to ` axios `, reference [PicGo/PicGo-Core#65](https://github.com/PicGo/PicGo-Core/issues/65), led to [TinyPng](https://tinypng.com/) is unavailable. Seems to be the last available version is [PicGo v2.3.0](https://github.com/Molunerfinn/PicGo/releases/tag/v2.3.0).

Fortunately I found [picgo-plugin-compress-webp-lossless](https://github.com/mrgeneralgoo/picgo-plugin-compress-webp-lossless), But its only upload [v1.0.1](https://www.npmjs.com/package/picgo-plugin-compress-webp-lossless). Its implementation is still through older versions of [picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress). However, the code updates the ` v1.1.0 `, but after refactoring with 'ES' it is not compatible with 'PicGo', and there are still some problems.

So there is ***`picgo-plugin-compress-next`*** birth 🎉

# 💥 comparison

<table border=2 style="
width: auto;
display: table;
margin-left: auto;
margin-right: auto;"
>
<tr>
<th></th>
<th colspan=2>compress-next</th>
<th colspan=2>compress</th>
</tr>
<tr>
<th rowspan=5>TinyPng</th>
<td>✅</td>
<td>version >= <b>2.3.1</b></td>
<td>❌</td>
<td>Highest version <b>2.3.0</b></td>
</tr>
<tr>
<td>✅</td>
<td>
Multiple keys are used in combination<br>
Use commas to separate and automatically clear whitespace
</td>
<td>✅</td>
<td>
Multiple keys are used in combination<br>
Strictly use commas, no whitespace
</td>
</tr>
<tr>
<td>✅</td>
<td>
TinyPngWeb is deprecated<br>
Throws an exception and prompts you to configure the Key
</td>
<td>❌</td>
<td>
TinyPngWeb is unavailable<br>
Throwing a blank exception can only view logs<br>
Page returns <b>404</b> or <b>413</b>
</td>
</tr>
<tr>
<td>✅</td>
<td>
<b>automatically skips</b> when an invalid Key appears<br>
Tags are no longer accessed unless manually refreshed
</td>
<td>❌</td>
<td>
An invalid Key occurs, throwing a blank exception<br>
View log, page return <b>404</b>
</td>
</tr>
<tr>
<td>✅</td>
<td>
Manual refresh <b>Valid</b> Key<br>
Supports manual refreshing of <b>all</b> keys<br>
You can set whether the Key is <b>automatically</b> refreshed across months
</td>
<td>❌</td>
<td>
If the valid Key reaches the number of times used, no access <br>
The configuration file can be reset only after it is deleted
</td>
</tr>
<!-- <tr>
<td>✅</td>
<td></td>
<td>❌</td>
<td></td>
</tr> -->
</table>


# 🎉 Function

- [x] Multiple keys can be used in combination
- [x] supports TinyPng compression for `PicGo >= v2.3.1`
- [x] disables `TinyPngWeb` and throws an exception
- [ ] Handle error `Key` and skip (under test)
- [ ] Handling refresh of `Key` (under test)


# Reporting Issues

[You can click here directly to create an issue](https://github.com/supine0703/picgo-plugin-compress-next/issues/new)



<!-- # Picgo Plugin Compress Webp Lossless
The original project has been inactive for quite some time. It's intended to provide continued maintenance and support.
This project is a plugin for [PicGo](https://github.com/Molunerfinn/PicGo) and [PicGo-Core](https://github.com/PicGo/PicGo-Core), enabling image compression using the remote service provided by [TinyPNG](https://tinypng.com/) or local compression using [imagemin](https://github.com/imagemin/imagemin).
Additionally, it supports lossless converting images to the WebP format.
Several enhancements and updates have been implemented in this fork:
- **Dependency Upgrades**: The project dependencies have been updated to their latest versions, ensuring better compression efficiency.
- **Syntax Upgrade**: The codebase has been migrated to use ES modules, providing better compatibility with modern JavaScript ecosystems.
- **Lossless Compression**: Local image compression has been improved to offer lossless compression, resulting in better compression quality.
Feel free to contribute to this project or report any issues you encounter. Your feedback and contributions are greatly appreciated! -->
110 changes: 98 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,107 @@
# Picgo Plugin Compress Webp Lossless

This is a fork of the [picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) repository.
[中文](./README.md) <-| [English](./README.en.md)

The original project has been inactive for quite some time. It's intended to provide continued maintenance and support.

This project is a plugin for [PicGo](https://github.com/Molunerfinn/PicGo) and [PicGo-Core](https://github.com/PicGo/PicGo-Core), enabling image compression using the remote service provided by [TinyPNG](https://tinypng.com/) or local compression using [imagemin](https://github.com/imagemin/imagemin).
### 🍴 分支

Additionally, it supports lossless converting images to the WebP format.
这是 [picgo-plugin-compress-webp-lossless](https://github.com/mrgeneralgoo/picgo-plugin-compress-webp-lossless) 的一个分支,同时它又是 [picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) 的分支

Several enhancements and updates have been implemented in this fork:

- **Dependency Upgrades**: The project dependencies have been updated to their latest versions, ensuring better compression efficiency.
- **Syntax Upgrade**: The codebase has been migrated to use ES modules, providing better compatibility with modern JavaScript ecosystems.
- **Lossless Compression**: Local image compression has been improved to offer lossless compression, resulting in better compression quality.
# ⚗️ 背景

Feel free to contribute to this project or report any issues you encounter. Your feedback and contributions are greatly appreciated!
[picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) 已经许久没有更新了,关键是在 `PicGo` 底层上传库从 `request` 迁移至 `axios` ,参考 [PicGo/PicGo-Core#65](https://github.com/PicGo/PicGo-Core/issues/65) ,导致 [TinyPng](https://tinypng.com/) 不可用。似乎最后一个可用版本是[PicGo v2.3.0](https://github.com/Molunerfinn/PicGo/releases/tag/v2.3.0)

# Reporting Issues
幸运的是我发现了 [picgo-plugin-compress-webp-lossless](https://github.com/mrgeneralgoo/picgo-plugin-compress-webp-lossless) ,但是其只上传了 [v1.0.1](https://www.npmjs.com/package/picgo-plugin-compress-webp-lossless) ,其实现仍然是 [picgo-plugin-compress](https://github.com/JuZiSang/picgo-plugin-compress) 的旧实现,但是其代码更新到了 `v1.1.0` ,可惜的是使用 `ES` 重构后无法兼容 `PicGo` ,并且仍旧存在些许问题。

于是便有了 ***`picgo-plugin-compress-next`*** 的诞生 🎉

# 💥 对比

<table border=2 style="
width: auto;
display: table;
margin-left: auto;
margin-right: auto;"
>
<tr>
<th></th>
<th colspan=2>compress-next</th>
<th colspan=2>compress</th>
</tr>
<tr>
<th rowspan=5>TinyPng</th>
<td>✅</td>
<td>version >= <b>2.3.1</b></td>
<td>❌</td>
<td>最高 version <b>2.3.0</b></td>
</tr>
<tr>
<td>✅</td>
<td>
多个 Key 叠加使用<br>
使用逗号分隔,自动清除空白符
</td>
<td>✅</td>
<td>
多个 Key 叠加使用<br>
严格使用逗号,不可有空白符
</td>
</tr>
<tr>
<td>✅</td>
<td>
TinyPngWeb 已弃用<br>
抛出异常并提示配置 Key
</td>
<td>❌</td>
<td>
TinyPngWeb 已不可用<br>
抛出空白异常 只能查看日志<br>
网页返回 <b>404</b> 或则 <b>413</b>
</td>
</tr>
<tr>
<td>✅</td>
<td>
出现无效 Key,<b>自动跳过</b><br>
标记并不再访问,除非手动刷新
</td>
<td>❌</td>
<td>
出现无效 Key,抛出空白异常<br>
查看日志,网页返回 <b>404</b>
</td>
</tr>
<tr>
<td>✅</td>
<td>
支持手动刷新<b>有效</b> Key<br>
支持手动刷新<b>所有</b> Key<br>
可设置是否跨月份<b>自动</b>刷新 Key
</td>
<td>❌</td>
<td>
若有效 Key 达到使用次数,则不在访问<br>
需要删除相应配置文件,才可重置
</td>
</tr>
<!-- <tr>
<td>✅</td>
<td></td>
<td>❌</td>
<td></td>
</tr> -->
</table>


# 🎉 功能
- [x] 支持多个 `Key` 叠加使用
- [x] 支持 `PicGo >= v2.3.1``TinyPng` 压缩
- [x] 禁用 `TinyPngWeb` 并抛出异常
- [ ] 对错误的 `Key` 处理并跳过(测试中)
- [ ] 处理 `Key` 的刷新问题(测试中)

# 报告问题

[你可以直接点击这里创建一个问题](https://github.com/supine0703/picgo-plugin-compress-next/issues/new)

[You can click here directly to create an issue](https://github.com/supine0703/picgo-plugin-compress-next/issues/new)
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"keywords": [
"picgo",
"picgo-plugin",
"picgo-gui-plugin"
"picgo-gui-plugin",
"compress",
"compress-next"
],
"devDependencies": {
"@types/crypto-js": "^4.2.2",
Expand Down

0 comments on commit 5d9a5fd

Please sign in to comment.