npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

picgo-plugin-compress-next

v1.5.2

Published

Image compression plugin for PicGo(>=^2.3.0). Update, adapt and optimize. Better support and richer features

Downloads

94

Readme

中文 <-| English

🍴 分支

这是 picgo-plugin-compress-webp-lossless 的一个分支,同时它又是 picgo-plugin-compress 的分支

🚀 部署使用

PicGo-Core 安装

  • 安装 picgo add compress-next
  • 选择使用 picgo use transformer
  • 参数配置 picgo config plugin compress-next

PicGo-Gui 安装

  • 打开详细窗口 > 插件设置 > 搜索 compress-next 即可安装,点击模块右下角配置参数
  • 或者,进入 picgo 目录 npm i picgo-plugin-compress-next
  • 离线安装参考这里

参数配置

  • Compress Type (过段时间会制作详细对比分析表):
    • tinypng: 无损压缩,需要上传到 tinypng
    • imagemin: 图片压缩不改变后缀名,支持 jpegpng,使用 mozjpegupng
    • imagemin-webp: 本地压缩为 webp 注意:有些图床(比如 sm.ms)不支持 webp 图片格式,会上传失败
    • webp-converter: 同上
  • Gif Compress Type:
  • Auto Refresh TinyPng Key Across Months:
    • yes: 检测到跨月(与上次使用时年月不同)则自动刷新 TinyPng API Key 的状态
    • no: 不检测,但是仍然记录年月
  • TinyPng API Key:
    • developers 中申请
    • 逗号,隔开,可使用多个 Key 叠加使用次数
压缩参数配置

参考 option.example.json

⚗️ 背景

picgo-plugin-compress 已经许久没有更新了,关键是在 PicGo 底层上传库从 request 迁移至 axios ,参考 PicGo/PicGo-Core#65 ,导致 TinyPng 不可用。似乎最后一个可用版本是PicGo v2.3.0

幸运的是我发现了 picgo-plugin-compress-webp-lossless ,但是其只上传了 v1.0.1 ,其实现仍然是 picgo-plugin-compress 的旧实现,但是其代码更新到了 v1.1.0 ,可惜的是使用 ES 重构后无法兼容 PicGo ,并且仍旧存在些许问题。

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

💥 对比

🎉 功能

  • [x] 支持多个 Key 叠加使用
  • [x] 支持 PicGo >= v2.3.1TinyPng 压缩
  • [x] 禁用 TinyPngWeb 并抛出异常
  • [x] 对错误的 Key 处理并跳过
  • [x] 处理 Key 的刷新问题:
    • [x] 刷新有效 Key
    • [x] 刷新所有 Key
    • [x] 跨越份自动刷新有效 Key
  • [x] 加入 webp-converter
  • [x] 加入 gift 2 webp 的能力
    • [x] 使用 webp-convertergwebp
    • [x] imagemin-gif2webp
  • [x] 可以根据自身需求配置压缩的具体参数
    • [x] imagemin-upng
    • [x] imagemin-mozjpeg
    • [x] imagemin-webp
    • [x] imagemin-gif2webp
    • [x] webp-converter-cwebp
    • [x] webp-converter-gwebp

压缩比较

TODO ... ...

报告问题

你可以直接点击这里创建一个问题