Add plugin 图片压缩 v0.1.4#242
Conversation
- Initial commit - feat: 首次版本发布 - docs: 添加项目说明文档 - docs: 添加发布变更记录
There was a problem hiding this comment.
Code Review
This pull request introduces a new image compression and format conversion plugin, zt-img-zip, which features a React-based frontend and a preload script utilizing the sharp library. The review feedback identifies several key areas for improvement: resolving a bug that forces lossy 8-bit palette compression on PNGs, implementing atomic file writes to prevent corruption during overwrites, and ensuring temporary files are cleaned up upon failure. Additionally, it is recommended to use image metadata instead of file extensions for format detection, remove the redundant preload.js file, and disable the item close button during active compression to prevent UI inconsistencies.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.



插件信息
sharp压缩图片并转换格式,支持 JPEG、PNG、WebP、AVIF、TIFF。本次变更
sharp图片处理管线,重新支持 JPEG、PNG、WebP、AVIF、TIFF 输出。sharp生产依赖安装到dist/preload/node_modules,ZTools 安装插件包后不需要再执行npm install。sharpnative 运行时依赖。sharp,本地开发时回退到项目根依赖。截图 / 演示
验证
npm cinpm run builddist/preload.cjs可从preload/node_modules/sharp加载sharp@0.34.5自检清单
plugin.json的name/title/version/description/author字段均已检查plugins/zt-img-zip/目录此 PR 由 ztools-plugin-cli 自动管理:每次
ztools publish在分支上追加一个 commit,PR 链接保持不变。