Run format
This commit is contained in:
parent
d6c4868ccf
commit
cb1ba4d878
1 changed files with 2 additions and 5 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue