Skip to content

Commit

Permalink
Made filehandle.read call compatible with Node18
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Dec 17, 2024
1 parent 771eea7 commit 804a713
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/support/media-files/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ async function hasImageSignature(file: string): Promise<boolean> {
const fh = await open(file, 'r');

try {
const fileHead = new Uint8Array(16);
await fh.read(fileHead);
return checkImageSignature(fileHead);
const buffer = new Uint8Array(16);
await fh.read({ buffer });
return checkImageSignature(buffer);
} finally {
await fh.close();
}
Expand Down

0 comments on commit 804a713

Please sign in to comment.