-
Notifications
You must be signed in to change notification settings - Fork 741
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
Can't run the test sapmle [Out of range error] #11
Comments
I got almost the same error with a slightly different value for the faulty offset when trying to unredact the sample pixellated secret.png:
Tried on macOS, just like @windskyshaoyu.
|
me too |
Added a pull request to fix this issue: |
Hi @MKesenheimer I tried your fix, which you have published on MKesenheimer Unfortunately I got nearly the same error as before: (node:1764) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. I tried it with a Windows 10 machine Build 19044.1566 |
@ercihan Did you try with the image that comes with the installation or with your own image? |
Have the same issue on When running
Electron produces the log file:
The last 3 lines are then repeated several times. Hope this could help figuring out what is wrong. |
@9cco Have you tried my pull request? |
@MKesenheimer Yes I tried your pull request now. Unfortunately it is still the same problem. Also tried updating |
Error occurred in handler for 'redact': RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 47100. Received -21376 |
same error |
I dug a little deeper into this and found some items of note. I dropped a console.log(image.bitmap) here and got the following output with the default images: {
width: 800,
height: 190,
depth: 8,
interlace: false,
palette: false,
color: true,
alpha: true,
bpp: 4,
colorType: 6,
data: <Buffer ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ... 607950 more bytes>,
gamma: 0
} Now, when I was setting up to depixelate an image from Discord, I used the following html: <HTML/>
<body style="padding: 8px 0px 0px 8px; background-color:#36393f;">
<span style="padding 0px 0px 0px 0px; color: #dcddde; font-weight: 400; font-family: Whitney,'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 32px; margin: 0;">a</span><span style="padding 0px 0px 0px 0px; margin: 0; color: #0000ff; font-size: 32px; font-weight: 400; font-family: Whitney,'Helvetica Neue',Helvetica,Arial,sans-serif;">█</span>
</body>
</HTML> And got the following image: {
width: 800,
height: 190,
depth: 8,
interlace: false,
palette: false,
color: true,
alpha: true,
bpp: 4,
colorType: 6,
data: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 607950 more bytes>,
gamma: 0
} Concerningly, this shows that all the bytes are black. What I suspect is that for whatever reason, the browser is not rendering the page, or is perhaps not rendering the page on time. I checked a variety of different possibilities (font? margin? something else?) but couldn't find the cause. If this was a timing issue, we'd expect to see some inconsistent failures in the base case, but that just doesn't happen. Perhaps someone with more insight on the matter could figure this out, but I'm afraid I just don't have time to at present. |
me, too |
@MKesenheimer Hi, there. I used your repo which was forked from here, and I used the same width and height (468 * 22) with yours in #11 (comment) and got errors in IDE console: so, always indicate "to be less than or equal to 30 but got a height of 32.000000" and "The value "-368" is invalid for option "size", have you met this, or do you know how to fix it now? appreciate it! |
Hey, I am not sure what happens in your case. I'm also not the creator of the project so I do not have all the insights. Cheers |
I think this problem somehow happens on macOS, but this project can be smoothly run on Windows (got this answer from some of my friends who run it on their Windows laptops). Not sure this solution is helpful for everyone. Anyways, thanks for @MKesenheimer 's help! |
I have run npm install successfully, but the I cant run the test sample successfully the error is :
Error occurred in handler for 'redact': RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 47100. Received -3968
at boundsError (internal/buffer.js:72:9)
at Buffer.readUInt32BE (internal/buffer.js:295:5)
at Jimp. (/Users/windsky/Downloads/unredacter-main/node_modules/@jimp/plugin-crop/dist/index.js:43:37)
at scan (/Users/windsky/Downloads/unredacter-main/node_modules/@jimp/utils/dist/index.js:53:9)
at Jimp.scanQuiet (/Users/windsky/Downloads/unredacter-main/node_modules/@jimp/core/dist/index.js:1262:32)
at Jimp.cropQuiet (/Users/windsky/Downloads/unredacter-main/node_modules/@jimp/plugin-crop/dist/index.js:42:12)
at Jimp. [as crop] (/Users/windsky/Downloads/unredacter-main/node_modules/@jimp/core/dist/index.js:1176:23)
at /Users/windsky/Downloads/unredacter-main/dist/main.js:363:47
at step (/Users/windsky/Downloads/unredacter-main/dist/main.js:52:23)
at Object.next (/Users/windsky/Downloads/unredacter-main/dist/main.js:33:53) {
code: 'ERR_OUT_OF_RANGE',
methodName: 'crop',
eventName: 'error'
}
The text was updated successfully, but these errors were encountered: