@midscene/shared 0.5.1 → 0.5.2-beta-20240929094445.0

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/es/img.js CHANGED
@@ -66,8 +66,8 @@ async function resizeImg(inputData, newSize) {
66
66
  return isBase64 ? resizedBuffer.toString("base64") : resizedBuffer;
67
67
  }
68
68
  function calculateNewDimensions(originalWidth, originalHeight) {
69
- const maxWidth = 768;
70
- const maxHeight = 2048;
69
+ const maxWidth = 2048;
70
+ const maxHeight = 768;
71
71
  let newWidth = originalWidth;
72
72
  let newHeight = originalHeight;
73
73
  const aspectRatio = originalWidth / originalHeight;
package/dist/lib/img.js CHANGED
@@ -110,8 +110,8 @@ async function resizeImg(inputData, newSize) {
110
110
  return isBase64 ? resizedBuffer.toString("base64") : resizedBuffer;
111
111
  }
112
112
  function calculateNewDimensions(originalWidth, originalHeight) {
113
- const maxWidth = 768;
114
- const maxHeight = 2048;
113
+ const maxWidth = 2048;
114
+ const maxHeight = 768;
115
115
  let newWidth = originalWidth;
116
116
  let newHeight = originalHeight;
117
117
  const aspectRatio = originalWidth / originalHeight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "0.5.1",
3
+ "version": "0.5.2-beta-20240929094445.0",
4
4
  "types": "./dist/types/index.d.ts",
5
5
  "main": "./dist/lib/index.js",
6
6
  "module": "./dist/es/index.js",
@@ -89,8 +89,8 @@ export function calculateNewDimensions(
89
89
  ) {
90
90
  // In low mode, the image is scaled to 512x512 pixels and 85 tokens are used to represent the image.
91
91
  // In high mode, the model looks at low-resolution images and then creates detailed crop images, using 170 tokens for each 512x512 pixel tile. In practical applications, it is recommended to control the image size within 2048x768 pixels
92
- const maxWidth = 768; // Maximum width
93
- const maxHeight = 2048; // Maximum height
92
+ const maxWidth = 2048; // Maximum width
93
+ const maxHeight = 768; // Maximum height
94
94
  let newWidth = originalWidth;
95
95
  let newHeight = originalHeight;
96
96