Skip to content

Commit 2635e13

Browse files
committed
don't validate buffer
1 parent aa5116d commit 2635e13

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const handler = async (event) => {
1212
// Parse the incoming multipart form-data
1313
const fileBuffer = await parseMultipart(event);
1414

15-
// Validate JPEG buffer
16-
if (fileBuffer[0] !== 0xff || fileBuffer[1] !== 0xd8) {
17-
throw new Error(
18-
`Invalid JPEG file. SOI marker not found. ${fileBuffer[0]}`
19-
);
20-
}
15+
// // Validate JPEG buffer
16+
// if (fileBuffer[0] !== 0xff || fileBuffer[1] !== 0xd8) {
17+
// throw new Error(
18+
// `Invalid JPEG file. SOI marker not found. ${fileBuffer[0]}`
19+
// );
20+
// }
2121

2222
// Decode the JPEG to get raw pixel data
2323
const decodedImage = jpeg.decode(fileBuffer, { useTArray: true });

0 commit comments

Comments
 (0)