mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
PNG alpha channel is converted to white instead of default ugly black
This commit is contained in:
parent
97c1b3061f
commit
d9f2bb37e7
@ -107,6 +107,9 @@ async function resize(buffer) {
|
|||||||
// we do resizing with max quality which will be trimmed during optimization step next
|
// we do resizing with max quality which will be trimmed during optimization step next
|
||||||
image.quality(100);
|
image.quality(100);
|
||||||
|
|
||||||
|
// when converting PNG to JPG we lose alpha channel, this is replaced by white to match Trilium white background
|
||||||
|
image.background(0xFFFFFFFF);
|
||||||
|
|
||||||
// getBuffer doesn't support promises so this workaround
|
// getBuffer doesn't support promises so this workaround
|
||||||
return await new Promise((resolve, reject) => image.getBuffer(jimp.MIME_JPEG, (err, data) => {
|
return await new Promise((resolve, reject) => image.getBuffer(jimp.MIME_JPEG, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user