Skip to content

Commit

Permalink
Pass decoder options to the underlying decoder when reading from file…
Browse files Browse the repository at this point in the history
…s and buffers, not just URLs
  • Loading branch information
DefiantCatgirl committed Nov 11, 2024
1 parent b6b0e41 commit 68162a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ export function createJimp<
options?: MimeTypeToDecodeOptions
) {
if (Buffer.isBuffer(url) || url instanceof ArrayBuffer) {
return this.fromBuffer(url);
return this.fromBuffer(url, options);
}

if (existsSync(url)) {
return this.fromBuffer(await readFile(url));
return this.fromBuffer(await readFile(url), options);
}

const [fetchErr, response] = await to(fetch(url));
Expand Down

0 comments on commit 68162a3

Please sign in to comment.