Refactor image to accept Buffer only

This commit is contained in:
Dolan
2018-08-12 23:07:31 +01:00
parent bc1132146f
commit 675192b86f
12 changed files with 35 additions and 66 deletions

View File

@ -124,20 +124,13 @@ export class File {
return this.document.createTable(rows, cols);
}
public createImage(filePath: string): Image {
const image = Media.addImage(this, filePath);
this.document.addParagraph(image.Paragraph);
return image;
}
public addImage(image: Image): File {
this.document.addParagraph(image.Paragraph);
return this;
}
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): Image {
const image = Media.addImageFromBuffer(this, buffer, width, height);
public createImage(buffer: Buffer, width?: number, height?: number): Image {
const image = Media.addImage(this, buffer, width, height);
this.document.addParagraph(image.Paragraph);
return image;