Closed TheOddLinguist closed 5 years ago
Hello!
I think the calls to sharp need to be changed a bit. Using updated sharp on the default presskit gives me few errors similar to
"background
is not a function"
because sharp changed its API.
Looks like in builder.js
line 256 the background option needs to be in flatten
now.
await sharp(imagePath)
.resize(450)
.flatten({ background: { r: 255, g: 255, b: 255, alpha: 1 }})
.jpeg()
.toFile(thumbPath)
I need to check with @solarsailer if I'm missing something, but yes we need to update the dependencies. :)
Thanks for your contribution.
We indeed needed to update all the dependencies anyways, which included this fix.
Locally (on node 12.6.0) I wasn't able to install
presskit
due to thesharp
dependency. I tried updating the version inpackage.json
, and it appears to have worked.I haven't tested it extensively beyond running
jest
and successfully building a site. If there's something specific I should test beyond that, let me know. Thanks!