Run format

This commit is contained in:
Dragory 2021-08-18 21:02:53 +03:00
parent d6c4868ccf
commit cb1ba4d878
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -15,16 +15,13 @@ async function getBufferFromUrl(url: string): Promise<Buffer> {
}
function bufferToPhotonImage(input: Buffer): photon.PhotonImage {
const base64 = input
.toString("base64")
.replace(/^data:image\/\w+;base64,/, "");
const base64 = input.toString("base64").replace(/^data:image\/\w+;base64,/, "");
return photon.PhotonImage.new_from_base64(base64);
}
function photonImageToBuffer(image: photon.PhotonImage): Buffer {
const base64 = image.get_base64()
.replace(/^data:image\/\w+;base64,/, "");
const base64 = image.get_base64().replace(/^data:image\/\w+;base64,/, "");
return Buffer.from(base64, "base64");
}