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

"Invalid typed array length" #32

Open
rejetto opened this issue Oct 5, 2024 · 3 comments
Open

"Invalid typed array length" #32

rejetto opened this issue Oct 5, 2024 · 3 comments

Comments

@rejetto
Copy link

rejetto commented Oct 5, 2024

hey!
i'm trying to npx resedit-cli --in hfs.exe --icon hfs.ico --out hfs2.exe
Archive.zip

but i get this error

resedit: RangeError: Invalid typed array length: 131072
    at new Uint8Array (<anonymous>)
    at copyBuffer (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/util/functions.js:36:11)
    at allocatePartialBinary (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/util/functions.js:42:5)
    at new IconItem (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/data/IconItem.js:60:24)
    at IconItem.from (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/data/IconItem.js:112:16)
    at new IconFile (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/data/IconFile.js:115:37)
    at IconFile.from (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit/dist/data/IconFile.js:134:16)
    at emitIcons (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit-cli/dist/emit/icons.js:43:44)
    at async emitResources (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit-cli/dist/run.js:279:17)
    at async run (file:///Users/rejetto/.npm/_npx/af7be33d5185a36e/node_modules/resedit-cli/dist/run.js:329:22)

it's an exe generated with pkg for node.js, and i'm running this under macos on arm64

@jet2jet
Copy link
Owner

jet2jet commented Oct 8, 2024

Thanks for the report.
It seems that the bitmap data in icon file has weird image size (biSizeImage), causing unexpected behavior in resedit-js.

I'll work to solve this problem, making the new version of resedit-js/resedit-js-cli.

@jet2jet
Copy link
Owner

jet2jet commented Oct 8, 2024

I published [email protected] to solve the issue.
Please use this version.
# Note that overwriting the icon instead of append, use --icon <icon-id>,hfs.ico (which <icon-id> may be 1 for Node.js).

@rejetto
Copy link
Author

rejetto commented Oct 8, 2024

thanks!
i'm already using the "1," but decided to remove it to simplify the test case.
in the meantime i workaround-ed the problem by using another file icon file.
you can close this issue, i guess

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