codeplay-common 4.6.8 → 4.6.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/files/take-screen-image.js +5 -10
- package/package.json +1 -1
|
@@ -93,7 +93,7 @@ const deviceProfiles = [
|
|
|
93
93
|
outputFormat: 'jpeg',
|
|
94
94
|
outputExtension: 'jpg',
|
|
95
95
|
storeRequirements: {
|
|
96
|
-
maxFileSizeBytes:
|
|
96
|
+
maxFileSizeBytes: 1000 * 1000,
|
|
97
97
|
minPixels: 320,
|
|
98
98
|
maxPixels: 1920,
|
|
99
99
|
minAspectRatio: 0.5,
|
|
@@ -2185,12 +2185,9 @@ async function captureFramedScreenshot(
|
|
|
2185
2185
|
const originalImageMetadata = profile.storeRequirements
|
|
2186
2186
|
? await sharp(screenshotBuffer).metadata()
|
|
2187
2187
|
: null;
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
const hasCustomFrameSize = Boolean(frameDimensions || (profile.framedWidth && profile.framedHeight));
|
|
2192
|
-
const frameWidth = frameDimensions?.width || profile.framedWidth || profile.width;
|
|
2193
|
-
const frameHeight = frameDimensions?.height || profile.framedHeight || profile.height;
|
|
2188
|
+
const hasCustomFrameSize = Boolean(profile.framedWidth && profile.framedHeight);
|
|
2189
|
+
const frameWidth = profile.framedWidth || profile.width;
|
|
2190
|
+
const frameHeight = profile.framedHeight || profile.height;
|
|
2194
2191
|
const frameScaleFactor = hasCustomFrameSize ? 1 : profile.deviceScaleFactor;
|
|
2195
2192
|
|
|
2196
2193
|
await client.send('Emulation.setDeviceMetricsOverride', {
|
|
@@ -2236,9 +2233,7 @@ async function captureFramedScreenshot(
|
|
|
2236
2233
|
});
|
|
2237
2234
|
|
|
2238
2235
|
const framedScreenshotBuffer = Buffer.from(framedScreenshot.data, 'base64');
|
|
2239
|
-
|
|
2240
|
-
validateStoreImage(profile, frameWidth, frameHeight, framedScreenshotBuffer);
|
|
2241
|
-
}
|
|
2236
|
+
validateStoreImage(profile, frameWidth, frameHeight, framedScreenshotBuffer);
|
|
2242
2237
|
|
|
2243
2238
|
fs.mkdirSync(framedProfileDirectory, { recursive: true });
|
|
2244
2239
|
fs.writeFileSync(
|