@leafer/image 1.6.2 → 1.6.4
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/package.json +5 -5
- package/src/ImageManager.ts +2 -2
- package/src/LeaferImage.ts +2 -2
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/image",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "@leafer/image",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/task": "1.6.
|
|
26
|
-
"@leafer/file": "1.6.
|
|
27
|
-
"@leafer/platform": "1.6.
|
|
25
|
+
"@leafer/task": "1.6.4",
|
|
26
|
+
"@leafer/file": "1.6.4",
|
|
27
|
+
"@leafer/platform": "1.6.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.6.
|
|
30
|
+
"@leafer/interface": "1.6.4"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/ImageManager.ts
CHANGED
|
@@ -32,8 +32,8 @@ export const ImageManager: IImageManager = {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
return FileHelper.
|
|
35
|
+
hasAlphaPixel(config: ILeaferImageConfig): boolean {
|
|
36
|
+
return FileHelper.alphaPixelTypes.some(item => I.isFormat(item, config))
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
isFormat(format: IExportFileType, config: ILeaferImageConfig): boolean {
|
package/src/LeaferImage.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class LeaferImage implements ILeaferImage {
|
|
|
19
19
|
public height: number
|
|
20
20
|
|
|
21
21
|
public isSVG: boolean
|
|
22
|
-
public
|
|
22
|
+
public hasAlphaPixel: boolean // check png / svg / webp
|
|
23
23
|
|
|
24
24
|
public get completed() { return this.ready || !!this.error }
|
|
25
25
|
|
|
@@ -46,7 +46,7 @@ export class LeaferImage implements ILeaferImage {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
ImageManager.isFormat('svg', config) && (this.isSVG = true)
|
|
49
|
-
ImageManager.
|
|
49
|
+
ImageManager.hasAlphaPixel(config) && (this.hasAlphaPixel = true)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
public load(onSuccess?: IFunction, onError?: IFunction): number {
|