Skip to content
dsh.fish
Bundle

dsh-image-uckkk

图片处理:读取图片尺寸/格式、缩放与格式转换(内置 ffmpeg,跨平台)

Source
uckkk
License
MIT
Updated
Updated 7 days ago

Readme

# dsh-image-uckkk · 图片处理

读取图片尺寸/格式、缩放与格式转换。基于内置 ffmpeg 二进制(跨平台)。纯 Node 实现。

## 提供的工具

| 工具 | 作用 |
|---|---|
| `image_info` | 读取宽×高与格式 |
| `resize_image` | 缩放(等比/指定尺寸)+ 转格式(jpg/png/webp) |

## 安装

```bash
dsh plugin add dsh-image-uckkk
```
安装后在 profile 的 `package.json` 的 `dsh.profile.bundles` 中加入 `"dsh-image-uckkk"`。

## 用法示例

```
把 hero.png 缩成 800 宽并转成 webp
→ 调用 resize_image(file="hero.png", width=800, outFile="hero.webp")
```

Install

dsh plugin --profile web add github:uckkk/dsh-image-uckkk#1ecda12fd48f5cff978fed58e2f56fd3b7f0f781

Profile: web

Source