@nitida/sdk 0.36.2 → 0.36.3
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 +11 -1
- package/package.json +2 -2
- package/skills/nitida-sdk/SKILL.md +20 -0
package/README.md
CHANGED
|
@@ -608,7 +608,7 @@ this table from the source, so it can't have the wrong one.
|
|
|
608
608
|
| `sm` | `s` | 640 | mobile thumbs, list cards |
|
|
609
609
|
| `md` | `m` | 1280 | desktop cards, modal previews |
|
|
610
610
|
| `lg` | `l` | 1920 (≈2K) | hero, full-bleed |
|
|
611
|
-
| `xl` | `x` | 3840 (4K) | print, 4K screens |
|
|
611
|
+
| `xl` | `x` | 3840 (4K) | print, 4K screens · a clean WebP base ≤ 3840 is reused as-is |
|
|
612
612
|
|
|
613
613
|
**Defaults — what actually runs:**
|
|
614
614
|
|
|
@@ -644,6 +644,16 @@ the full responsive ladder ≈ 4× source bytes.
|
|
|
644
644
|
(3840) yields a 1080×720 `xl` variant, not a blurry 3840-wide stretch.
|
|
645
645
|
The preset is a **ceiling**, not a target.
|
|
646
646
|
|
|
647
|
+
**`xl` reuses a ≤ 4K base byte-for-byte.** 4K is the cap for listing
|
|
648
|
+
photos. When the uploaded base is a clean WebP no larger than 3840 px
|
|
649
|
+
(single frame, no EXIF orientation, no EXIF/XMP), the server stores it
|
|
650
|
+
as `xl` unchanged: same sha256, no second lossy pass. Anything else (a
|
|
651
|
+
larger base, JPEG/PNG/HEIC, animated or EXIF-bearing WebP) is re-encoded
|
|
652
|
+
to WebP q82 as before. The default `compressImage` output (3840 px WebP)
|
|
653
|
+
qualifies. URLs, keys and response shapes do not change; `xl` is still
|
|
654
|
+
its own object, the same size as the base. Already-stored assets keep
|
|
655
|
+
their existing `xl`.
|
|
656
|
+
|
|
647
657
|
### Non-image / passthrough
|
|
648
658
|
|
|
649
659
|
| Preset | Code | Purpose |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitida/sdk",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.3",
|
|
4
4
|
"description": "nitida — the media SDK: browser and mobile upload with resume, client-side compression, on-the-fly transforms behind a CDN, video transcode, HLS ladders and AI proxies. Multi-tenant.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"react": ">=18",
|
|
76
|
-
"@nitida/asset-client": "^0.24.
|
|
76
|
+
"@nitida/asset-client": "^0.24.1",
|
|
77
77
|
"@nitida/asset-compressor-web": "^0.6.1",
|
|
78
78
|
"@nitida/asset-compressor-native": "^0.2.1"
|
|
79
79
|
},
|
|
@@ -186,6 +186,26 @@ everyone, and the ladder buys you nothing.
|
|
|
186
186
|
- ⚠️ The **first** request of each width is generated cold, then cached at the
|
|
187
187
|
edge immutably. Warm them after upload if the first visitor matters.
|
|
188
188
|
|
|
189
|
+
### `xl` is the base itself when the base is already ≤ 4K
|
|
190
|
+
|
|
191
|
+
4K (3840 px long side) is the cap for listing photos, and a base inside it is
|
|
192
|
+
already final. So at upload the server stores a **clean WebP base ≤ 3840 px**
|
|
193
|
+
(single frame, no EXIF orientation, no EXIF/XMP block) as `xl`
|
|
194
|
+
**byte-identical**: same sha256, no decode, no second lossy pass. Anything else
|
|
195
|
+
is re-encoded to WebP q82 as before: a base larger than 3840 px (resized to
|
|
196
|
+
3840), a JPEG/PNG/HEIC, an animated WebP, or a WebP carrying EXIF/XMP (the
|
|
197
|
+
re-encode strips metadata, so GPS never reaches a public URL).
|
|
198
|
+
|
|
199
|
+
- The default browser compressor (`compressImage`, 3840 px WebP via canvas,
|
|
200
|
+
which writes no EXIF) produces exactly such a base. Upload with `"xl"` in
|
|
201
|
+
`presets` and `xl` costs no quality.
|
|
202
|
+
- URLs, keys (`…/x/<sha>.webp`), `presets` and response shapes are unchanged.
|
|
203
|
+
`xl` is still its own stored object (a copy of the base's bytes), so it
|
|
204
|
+
weighs the same as the base, not less.
|
|
205
|
+
- This applies to uploads processed on or after the server change. Assets
|
|
206
|
+
already stored keep the `xl` they have. `regenerate(id, { presets: ["xl"] })`
|
|
207
|
+
applies the new rule.
|
|
208
|
+
|
|
189
209
|
### ⚠️⚠️ On a LADDERED asset, an explicit `quality` compresses the image TWICE
|
|
190
210
|
|
|
191
211
|
> Full measurements, with the method: <https://nitida.gofuture.space/guides/transform-benchmark/>
|