Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError when creating an image #77

Closed
nicolaracco opened this issue May 18, 2018 · 2 comments
Closed

RangeError when creating an image #77

nicolaracco opened this issue May 18, 2018 · 2 comments

Comments

@nicolaracco
Copy link

nicolaracco commented May 18, 2018

I'm trying to add an image (that I can correctly open with other tools), using a simple document.createImage('./cover.jpg');. But I get:

RangeError: Index out of range
    at checkOffset (buffer.js:970:11)
    at Buffer.readUInt16LE (buffer.js:1016:5)
    at Object.isCUR [as detect] (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:47491:14)
    at module.exports (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:48009:33)
    at lookup (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:47349:14)
    at module.exports (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:47449:12)
    at Media.addMedia (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:47292:28)
    at File.createImage (/Users/gawaine/dev/artshell-docx-exporter/node_modules/docx/build/index.js:46088:38)
    at createDocument (/Users/gawaine/dev/artshell-docx-exporter/index.js:43:26)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
@dolanmiu
Copy link
Owner

dolanmiu commented May 18, 2018

Interesting,

I'll have a look later

Have you tried a different image?

@dolanmiu
Copy link
Owner

Deprecated.

createImage only supports Buffers and base64 strings now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants