Merge pull request #1384 from simonbrunel/fix/template-images-browser

Fix reading template images in the browser
This commit is contained in:
Dolan
2022-01-20 19:40:36 +00:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# https://prettier.io/docs/en/options.html#end-of-line
* text=auto eol=lf

View File

@ -157,7 +157,8 @@ export class ImportDotx {
const hyperLinkReferences = this.findReferenceFiles(xmlRef).filter((r) => r.type === RelationshipType.HYPERLINK); const hyperLinkReferences = this.findReferenceFiles(xmlRef).filter((r) => r.type === RelationshipType.HYPERLINK);
for (const r of wrapperImagesReferences) { for (const r of wrapperImagesReferences) {
const buffer = await zipContent.files[`word/${r.target}`].async("nodebuffer"); const bufferType = JSZip.support.arraybuffer ? "arraybuffer" : "nodebuffer";
const buffer = await zipContent.files[`word/${r.target}`].async(bufferType);
const mediaData = media.addMedia(buffer, { const mediaData = media.addMedia(buffer, {
width: 100, width: 100,
height: 100, height: 100,