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

@ -36,8 +36,8 @@ export class HeaderWrapper {
this.header.addChildElement(childElement);
}
public createImage(image: string): void {
const mediaData = this.media.addMedia(image, this.relationships.RelationshipCount);
public createImage(image: Buffer, width?: number, height?: number): void {
const mediaData = this.media.addMedia(image, this.relationships.RelationshipCount, width, height);
this.relationships.createRelationship(
mediaData.referenceId,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",