From 65e50eb7b6d7b10a193bba7d292804ac0e55be18 Mon Sep 17 00:00:00 2001 From: Aleksandr Kadykov Date: Wed, 27 Nov 2024 13:05:56 +0000 Subject: [PATCH] Fix JPEG image size determination (#12542) --- .changeset/bright-pants-trade.md | 5 +++++ .../astro/src/assets/utils/vendor/image-size/types/jpg.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/bright-pants-trade.md diff --git a/.changeset/bright-pants-trade.md b/.changeset/bright-pants-trade.md new file mode 100644 index 0000000000..00267ad71b --- /dev/null +++ b/.changeset/bright-pants-trade.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix JPEG image size determination diff --git a/packages/astro/src/assets/utils/vendor/image-size/types/jpg.ts b/packages/astro/src/assets/utils/vendor/image-size/types/jpg.ts index 1ccf2d99f1..763cfc98c0 100644 --- a/packages/astro/src/assets/utils/vendor/image-size/types/jpg.ts +++ b/packages/astro/src/assets/utils/vendor/image-size/types/jpg.ts @@ -122,7 +122,8 @@ export const JPG: IImage = { // Every JPEG block must begin with a 0xFF if (input[i] !== 0xff) { - input = input.slice(1) + // Change from upstream: fix non-0xFF blocks skipping + input = input.slice(i) continue }