@life-palette/media 0.2.1
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 +33 -0
- package/dist/index.cjs +1297 -0
- package/dist/index.d.cts +135 -0
- package/dist/index.d.mts +135 -0
- package/dist/index.mjs +1290 -0
- package/dist/rolldown-runtime-BPOCksWG.mjs +24 -0
- package/dist/rolldown-runtime-y5ARvAq5.cjs +35 -0
- package/dist/spark-md5-BgTNfY_D.cjs +607 -0
- package/dist/spark-md5-k2XpwQcg.mjs +604 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @life-palette/media
|
|
2
|
+
|
|
3
|
+
Browser-side media analysis: dominant colors, BlurHash, ArtHash, EXIF for images; technical metadata for videos (via mediainfo.js WASM). All work happens client-side, no upload required.
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
- `hash` — `hashBlob(blob, onProgress?)` (MD5)
|
|
8
|
+
- `analyze` — `analyzeMedia(file, options)` (orchestrator)
|
|
9
|
+
- `video-metadata` — `loadMediaInfoVideoMetadata`, `mapMediaInfoResult`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @life-palette/media
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { analyzeMedia } from "@life-palette/media";
|
|
21
|
+
|
|
22
|
+
const result = await analyzeMedia(file, {
|
|
23
|
+
colorCount: 5,
|
|
24
|
+
includeRawExif: false,
|
|
25
|
+
onProgress: ({ stage, percent }) => console.log(stage, percent),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
console.log(result.image?.colors, result.image?.blurhash);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT
|