@mpcore/simulator 0.1.3 → 0.1.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/dist/index.d.mts +1 -1
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1863,10 +1863,12 @@ function inferImageType(filePath, fileContent) {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
function inferImageSize(fileContent) {
|
|
1865
1865
|
try {
|
|
1866
|
-
const
|
|
1866
|
+
const config = JSON.parse(fileContent)?.config;
|
|
1867
|
+
const destHeight = config && "destHeight" in config ? config.destHeight : void 0;
|
|
1868
|
+
const destWidth = config && "destWidth" in config ? config.destWidth : void 0;
|
|
1867
1869
|
return {
|
|
1868
|
-
height:
|
|
1869
|
-
width:
|
|
1870
|
+
height: destHeight ?? config?.height ?? 0,
|
|
1871
|
+
width: destWidth ?? config?.width ?? 0
|
|
1870
1872
|
};
|
|
1871
1873
|
} catch {
|
|
1872
1874
|
return {
|
|
@@ -2647,7 +2649,7 @@ function createHeadlessWxState() {
|
|
|
2647
2649
|
width
|
|
2648
2650
|
};
|
|
2649
2651
|
}),
|
|
2650
|
-
type: mediaTypes.length > 1 ? "mix" : mediaTypes[0]
|
|
2652
|
+
type: mediaTypes.length > 1 ? "mix" : mediaTypes[0] ?? "image"
|
|
2651
2653
|
};
|
|
2652
2654
|
},
|
|
2653
2655
|
chooseVideo(option) {
|
package/package.json
CHANGED