Skip to content

Commit 4cd5c61

Browse files
[fix] Fixed bug of incompatibility with gulp 5.
1 parent a933bde commit 4cd5c61

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ async function convert(file, newFileFormat, options) {
7979
if (newFileFormat == 'heif')
8080
options.compression = 'av1'
8181

82-
let sharpInstance =
83-
sharp(file.contents, DEFAULT_SHARP_OPTIONS)
82+
let sharpBuffer =
83+
await sharp(file.path, DEFAULT_SHARP_OPTIONS)
8484
.toFormat(newFileFormat, Object.assign(DEFAULT_CONVERSION_OPTIONS, options))
85+
.toBuffer()
8586

86-
return toVinyl(await sharpInstance.toBuffer(), newFileFormat, file)
87+
return toVinyl(sharpBuffer, newFileFormat, file)
8788
}
8889

8990
function toVinyl(buffer, newFileFormat, file) {

0 commit comments

Comments
 (0)