Skip to content

Latest commit

 

History

History
219 lines (185 loc) · 7.66 KB

README.en.md

File metadata and controls

219 lines (185 loc) · 7.66 KB

中文 |-> English

picgo-plugin-compress-next

dm v mit

🍴 Fork

This is a fork of the picgo-plugin-compress-webp-lossless repository, And it is a fork of the picgo-plugin-compress repository.

🚀 Deployment and Use

PicGo-Core Install

  • Install picgo add compress-next.
  • Choose to use picgo use transformer.
  • Configuration picgo config plugin compress-next.

PicGo-Gui Install

  • Open the details window > Plug-in Settings > Search for compress-next to install, click on the lower right corner of the module to configure.
  • or, go to the 'picgo' directory 'npm i picgo-plugin-compress-next'.
  • Offline installation Reference here.

Configuration

  • Compress Type (A detailed comparative analysis table will be made later):
    • tinypng: Damaged compression, need to upload to tinypng.
    • imagemin: Image compression does not change the suffix, support jpeg and png. Use mozjpeg and upng.
    • imagemin-webp: Local compression to webp. Note: Some beds (such as sm.ms) do not support webp image format and will fail to upload.
    • webp-converter: Same as the last one.
  • Gif Compress Type:
  • Auto Refresh TinyPng Key Across Months:
    • yes: The TinyPng API Key status is automatically refreshed if it is detected to be across months (different from the last time it was used).
    • no: No detection, but still record the date.
  • TinyPng API Key:
    • Apply in developers.
    • Separated by comma(,), multiple keys can be used to superimpose the usage times.
Compression parameter configuration

Go to see option.example.json

⚗️ Background

The 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, led to TinyPng is unavailable. Seems to be the last available version is PicGo v2.3.0.

Fortunately I found the picgo-plugin-compress-webp-lossless, But its only upload v1.0.1. Its implementation is still through older versions of the 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

compress-next compress
TinyPng version >= 2.3.1 🟡 Highest version 2.3.0
Multiple keys are used in combination
Use commas to separate and automatically clear whitespace
Multiple keys are used in combination
Strictly use commas, no whitespace
TinyPngWeb is deprecated
Throws an exception and prompts you to configure the Key
TinyPngWeb is unavailable
Throwing a blank exception can only view logs
Page returns 404 or 413
automatically skips when an invalid Key appears
Tags are no longer accessed unless manually refreshed
An invalid Key occurs, throwing a blank exception
View log, page return 404
Supports manual refreshing of Valid Keys
Supports manual refreshing of all Keys
Can be set to automatically refresh Key if across months
If the valid Key reaches the number of times, the access is stopped
The configuration file can be reset only after it is deleted
imagemin mozjpeg & upng:
Can configure compression parameters
🟡 mozjpeg & upng:
Support for local lossy conversion
imagemin-webp:
Can configure compression parameters
🟡 imagemin-webp:
Supports local lossy conversion to webp
imagemin-gif2webp:
Supports gif local lossy conversion to webp
Conversion from gif to webp is not supported
Multiple sets of compression configuration parameters are prepared, and you can configure them yourself Fixed preset parameters
webp-converter jpeg, png, webp compressed to webp Cannot use webp-converter
Support gif compression to webp

🎉 Function

  • Multiple keys can be used in combination
  • supports TinyPng compression for PicGo >= v2.3.1
  • disables TinyPngWeb and throws an exception
  • Handle error Key and skip
  • Handling refresh of Key
    • Refreshing of valid keys
    • Refreshing of all keys
    • Automatically refresh valid keys if across months
  • add webp-converter (Smaller volume and Higher speed)
  • Add ability of gift 2 webp
    • Use webp-converter's gwebp
    • imagemin-gif2webp
  • Can set compression parameters based on your requirements
    • imagemin-upng
    • imagemin-mozjpeg
    • imagemin-webp
    • imagemin-gif2webp
    • webp-converter-cwebp
    • webp-converter-gwebp

Reporting Issues

You can click here directly to create an issue