LinusU / decode-ico

Decode `.ico` icons
19 stars 2 forks source link

Error: too big array size #8

Open HironTez opened 1 year ago

HironTez commented 1 year ago

Hi, thanks for the tool. I'm having trouble decoding Google Chrome's ico buffer. The size of the array is larger than node.js can handle. This is the error message:

RangeError: Invalid typed array length: 1353219496
    at new Uint8Array (<anonymous>)
    at ...\node_modules\decode-ico\index.js:87:18
    at Function.from (<anonymous>)
    at decodeIco (...\node_modules\decode-ico\index.js:64:16)
LinusU commented 1 year ago

Can you share a Minimal, Reproducible Example?

HironTez commented 1 year ago

@LinusU Sure. As i mentioned it's just the Google Chrome icon. That's the snippet that results the error:

import { extractIcon } from "@inithink/exe-icon-extractor";
import icoToPng from "ico-to-png";

const icon = extractIcon("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "large");
icoToPng(icon, 256).then((png) => console.log(png));

It works fine with other apps