Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit 67d902d

Browse files
committed
fix: make sure encoding options are passed to encode when no format is specified
1 parent 7e22b9c commit 67d902d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/save/write.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function getDataToWrite(
121121
if (!options || !('format' in options)) {
122122
const extension = nodePath.extname(destinationPath).slice(1).toLowerCase();
123123
if (extension === 'png' || extension === 'jpg' || extension === 'jpeg') {
124-
return encode(image, { format: extension });
124+
return encode(image, { ...options, format: extension });
125125
} else {
126126
throw new RangeError(
127127
'image format could not be determined from file extension. Use a supported extension or specify the format option',

0 commit comments

Comments
 (0)