heic-to 1.1.8 → 1.1.9
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 +2 -1
- package/dist/csp/heic-to.d.ts +33 -0
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Currently, heic-to is using [libheif 1.19.7](https://github.com/strukturag/libhe
|
|
|
8
8
|
|
|
9
9
|
| Release | libheif |
|
|
10
10
|
| -------- | -------- |
|
|
11
|
+
| 1.1.9 | 1.19.7 |
|
|
11
12
|
| 1.1.8 | 1.19.7 |
|
|
12
13
|
| 1.1.7 | 1.19.6 |
|
|
13
14
|
| 1.1.6 | 1.19.5 |
|
|
@@ -66,7 +67,7 @@ Fix it by using `csp/heic-to`
|
|
|
66
67
|
|
|
67
68
|
```diff
|
|
68
69
|
- import { heicTo } from "heic-to"
|
|
69
|
-
+ import { heicTo } from "
|
|
70
|
+
+ import { heicTo } from "heic-to/csp"
|
|
70
71
|
```
|
|
71
72
|
|
|
72
73
|
### Development guide
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a file is in HEIC format.
|
|
3
|
+
* @param file - The file to check.
|
|
4
|
+
* @returns A promise that resolves to true if the file is HEIC, false otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isHeic(file: File): Promise<boolean>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Options for converting HEIC images.
|
|
10
|
+
*/
|
|
11
|
+
export interface HeicToOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The HEIC image blob to convert.
|
|
14
|
+
*/
|
|
15
|
+
blob: Blob;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The desired output image MIME type (e.g., 'image/jpeg', 'image/png').
|
|
19
|
+
*/
|
|
20
|
+
type: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The quality of the output image, between 0 and 1.
|
|
24
|
+
*/
|
|
25
|
+
quality?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Converts a HEIC image to another format.
|
|
30
|
+
* @param options - The conversion options.
|
|
31
|
+
* @returns A promise that resolves to the converted image blob.
|
|
32
|
+
*/
|
|
33
|
+
export declare function heicTo(options: HeicToOptions): Promise<Blob>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heic-to",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Converting HEIF/HEIF image formats to PNG/JPEG in the browser",
|
|
5
5
|
"main": "dist/heic-to.js",
|
|
6
|
+
"export": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/heic-to.js",
|
|
9
|
+
"require": "./dist/heic-to.js",
|
|
10
|
+
"types": "./dist/heic-to.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./csp": {
|
|
13
|
+
"import": "./dist/csp/heic-to.js",
|
|
14
|
+
"require": "./dist/csp/heic-to.js",
|
|
15
|
+
"types": "./dist/csp/heic-to.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
6
18
|
"scripts": {
|
|
7
19
|
"build": "node esbuild.mjs",
|
|
8
20
|
"s": "npx http-server -o ./example"
|