@inoo-ch/payload-image-optimizer 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,6 +128,32 @@ collections: {
|
|
|
128
128
|
|
|
129
129
|
All format conversion runs as async background jobs, so uploads return immediately.
|
|
130
130
|
|
|
131
|
+
## How It Differs from Payload's Default Image Handling
|
|
132
|
+
|
|
133
|
+
Payload CMS ships with [sharp](https://sharp.pixelplumbing.com/) built-in and can resize images and generate sizes on upload. This plugin **does not double-process your images** — it intercepts the raw upload in a `beforeChange` hook *before* Payload's own sharp pipeline runs, and writes the optimized buffer back to `req.file.data`. When Payload's built-in `uploadFiles` step kicks in to generate your configured sizes, it works from the already-optimized file, not the raw original.
|
|
134
|
+
|
|
135
|
+
### Comparison
|
|
136
|
+
|
|
137
|
+
| Capability | Payload Default | With This Plugin |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| Resize to max dimensions | Manual via `imageSizes` config | Automatic — configure once globally or per-collection |
|
|
140
|
+
| WebP/AVIF conversion | Requires custom hooks | Built-in, zero-config |
|
|
141
|
+
| EXIF metadata stripping | Not built-in | Automatic (configurable) |
|
|
142
|
+
| Blur hash placeholders | Requires custom hooks | ThumbHash generated automatically |
|
|
143
|
+
| Optimization status & savings | Not available | Admin sidebar panel per image |
|
|
144
|
+
| Bulk re-process existing images | Not available | One-click regeneration with progress tracking |
|
|
145
|
+
| Next.js `<Image>` with blur placeholder | Manual wiring | Drop-in `<ImageBox>` component |
|
|
146
|
+
| Per-collection format/quality overrides | N/A | Supported |
|
|
147
|
+
|
|
148
|
+
### CPU & Resource Impact
|
|
149
|
+
|
|
150
|
+
- **Single-format mode** (e.g. WebP only with `replaceOriginal: true`) adds virtually zero overhead compared to Payload's default sharp processing — the plugin replaces the sharp pass rather than adding a second one.
|
|
151
|
+
- **Additional format variants** (e.g. both WebP and AVIF) run as background jobs after upload — this is the one area where you'll see extra CPU usage vs vanilla Payload.
|
|
152
|
+
- **ThumbHash generation** processes a 100×100px thumbnail — negligible impact.
|
|
153
|
+
- **Bulk regeneration** processes images sequentially, not all at once, so it won't spike your server.
|
|
154
|
+
|
|
155
|
+
If you're on a resource-constrained server, use single-format mode and you'll be at roughly the same CPU cost as stock Payload.
|
|
156
|
+
|
|
131
157
|
## Admin UI
|
|
132
158
|
|
|
133
159
|
The plugin adds an **Optimization Status** panel to the document sidebar showing:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inoo-ch/payload-image-optimizer",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Payload CMS plugin for automatic image optimization — WebP/AVIF conversion, resize, EXIF strip, ThumbHash placeholders, and bulk regeneration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|