Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refactor: replace image-size with image-meta (#4767)

Bogdan Chadkinac90f03a09a9
diff --git a/packages/asset-uploader/package.json b/packages/asset-uploader/package.json
index 07770f4aff..4b9e248020 100644
--- a/packages/asset-uploader/package.json
+++ b/packages/asset-uploader/package.json
@@ -11,12 +11,12 @@
},
"dependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
- "@smithy/signature-v4": "^4.2.3",
+ "@smithy/signature-v4": "^5.0.1",
"@webstudio-is/fonts": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"@webstudio-is/trpc-interface": "workspace:*",
"fontkit": "^2.0.4",
- "image-size": "^1.1.1",
+ "image-meta": "^0.2.1",
"immer": "^10.1.1",
"nanoid": "^5.0.9",
"warn-once": "^0.1.1"
diff --git a/packages/asset-uploader/src/utils/get-asset-data.ts b/packages/asset-uploader/src/utils/get-asset-data.ts
index 7e0fdd5f2b..89d8a6982a 100644
--- a/packages/asset-uploader/src/utils/get-asset-data.ts
+++ b/packages/asset-uploader/src/utils/get-asset-data.ts
@@ -1,5 +1,5 @@
import { z } from "zod";
-import { imageSize } from "image-size";
+import { imageMeta } from "image-meta";
import { FontMeta } from "@webstudio-is/fonts";
import { ImageMeta } from "@webstudio-is/sdk";
import { getFontData } from "./font-data";
@@ -34,7 +34,7 @@ export const getAssetData = async (
if (options.type === "image") {
let image: undefined | { format: string; width: number; height: number };
try {
- const parsed = imageSize(Buffer.from(options.data));
+ const parsed = imageMeta(Buffer.from(options.data));
if (parsed.type && parsed.width && parsed.height) {
image = {
format: parsed.type,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 307f2a1ca3..bf4ac28910 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1041,8 +1041,8 @@ importers:
specifier: ^5.2.0
version: 5.2.0
'@smithy/signature-v4':
- specifier: ^4.2.3
- version: 4.2.3
+ specifier: ^5.0.1
+ version: 5.0.1
'@webstudio-is/fonts':
specifier: workspace:*
version: link:../fonts
@@ -1055,9 +1055,9 @@ importers:
fontkit:
specifier: ^2.0.4
version: 2.0.4
- image-size:
- specifier: ^1.1.1
- version: 1.1.1
+ image-meta:
+ specifier: ^0.2.1
+ version: 0.2.1
immer:
specifier: ^10.1.1
version: 10.1.1
@@ -4885,49 +4885,53 @@ packages:
resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==}
engines: {node: '>=14.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==}
+ engines: {node: '>=18.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-FP2LepWD0eJeOTm0SjssPcgqAlDFzOmRXqXmGhfIM52G7Lrox/pcpQf6RP4F21k0+O12zaqQt5fCDOeBtqY6Cg==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==}
+ engines: {node: '>=18.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-pPSQQ2v2vu9vc8iew7sszLd0O09I5TRc5zhY71KA+Ao0xYazIG+uLeHbTJfIWGO3BGVLiXjUr3EEeCcEQLjpWQ==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==}
+ engines: {node: '>=18.0.0'}
'@smithy/[email protected]':
resolution: {integrity: sha512-XKLcLXZY7sUQgvvWyeaL/qwNPp6V3dWcUjqrQKjSb+tzYiCy340R/c64LV5j+Tnb2GhmunEX0eou+L+m2hJNYA==}
engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==}
+ engines: {node: '>=18.0.0'}
+
'@smithy/[email protected]':
resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==}
engines: {node: '>=14.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==}
+ engines: {node: '>=18.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==}
+ engines: {node: '>=18.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-eJO+/+RsrG2RpmY68jZdwQtnfsxjmPxzMlQpnHKjFPwrYqvlcT+fHdT+ZVwcjlWSrByOhGr9Ff2GG17efc192A==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==}
+ engines: {node: '>=18.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==}
+ engines: {node: '>=18.0.0'}
'@smithy/[email protected]':
resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==}
engines: {node: '>=14.0.0'}
- '@smithy/[email protected]':
- resolution: {integrity: sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==}
- engines: {node: '>=16.0.0'}
+ '@smithy/[email protected]':
+ resolution: {integrity: sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==}
+ engines: {node: '>=18.0.0'}
'@stitches/[email protected]':
resolution: {integrity: sha512-ErptbQehV25Da6LtZuM/51kGNK/UvlRY2da9IhhfXQ9h4bmf2f+lYFiJQ9j43O1kwYr6iYJIBRM47FEbsUWffw==}
@@ -6695,11 +6699,6 @@ packages:
resolution: {integrity: sha512-K6acvFaelNxx8wc2VjbIzXKDVB0Khs0QT35U6NkGfTdCmjLNcO2945m7RFNR9/RPVFm48hq7QPzK8uGH18HCGw==}
- resolution: {integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==}
- engines: {node: '>=16.x'}
- hasBin: true
-
resolution: {integrity: sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==}
@@ -8040,9 +8039,6 @@ packages:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
- resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==}
-
resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==}
@@ -12004,50 +12000,54 @@ snapshots:
dependencies:
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
- '@smithy/types': 3.7.1
+ '@smithy/types': 4.1.0
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
- '@smithy/is-array-buffer': 3.0.0
- '@smithy/protocol-http': 4.1.7
- '@smithy/types': 3.7.1
- '@smithy/util-hex-encoding': 3.0.0
- '@smithy/util-middleware': 3.0.10
- '@smithy/util-uri-escape': 3.0.0
- '@smithy/util-utf8': 3.0.0
+ '@smithy/is-array-buffer': 4.0.0
+ '@smithy/protocol-http': 5.0.1
+ '@smithy/types': 4.1.0
+ '@smithy/util-hex-encoding': 4.0.0
+ '@smithy/util-middleware': 4.0.1
+ '@smithy/util-uri-escape': 4.0.0
+ '@smithy/util-utf8': 4.0.0
tslib: 2.8.1
'@smithy/[email protected]':
dependencies:
tslib: 2.8.1
+ '@smithy/[email protected]':
+ dependencies:
+ tslib: 2.8.1
+
'@smithy/[email protected]':
dependencies:
'@smithy/is-array-buffer': 2.2.0
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
- '@smithy/is-array-buffer': 3.0.0
+ '@smithy/is-array-buffer': 4.0.0
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
- '@smithy/types': 3.7.1
+ '@smithy/types': 4.1.0
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
tslib: 2.8.1
@@ -12056,9 +12056,9 @@ snapshots:
'@smithy/util-buffer-from': 2.2.0
tslib: 2.8.1
- '@smithy/[email protected]':
+ '@smithy/[email protected]':
dependencies:
- '@smithy/util-buffer-from': 3.0.0
+ '@smithy/util-buffer-from': 4.0.0
tslib: 2.8.1
'@stitches/[email protected](patch_hash=knml42mpr6mlzseo3d6gjljiq4)([email protected])':
@@ -14242,10 +14242,6 @@ snapshots:
- dependencies:
- queue: 6.0.2
-
@@ -15946,10 +15942,6 @@ snapshots:
- dependencies:
- inherits: 2.0.4
-