question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERR_BUFFER_OUT_OF_BOUNDS while parsing png (windows, linux subsystem)

See original GitHub issue

Running imageSize on the attached png throws an out of bounds exeption while using Linux on Windows. The package works fine for other png and jpg files. The package works fine parsing the same file on macOS.

Error:

internal/buffer.js:70
    throw new ERR_BUFFER_OUT_OF_BOUNDS();
    ^
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
    at boundsError (internal/buffer.js:70:11)
    at Buffer.readUInt16LE (internal/buffer.js:229:5)
    at Object.validate (/<redacted>/node_modules/image-size/dist/types/cur.js:7:20)
    at finder (/<redacted>/node_modules/image-size/dist/detector.js:26:55)
    at Array.find (<anonymous>)
    at Object.detector (/<redacted>/node_modules/image-size/dist/detector.js:27:17)
    at lookup (/<redacted>/node_modules/image-size/dist/index.js:32:29)
    at imageSize (/<redacted>/node_modules/image-size/dist/index.js:102:16)
    at <redacted> (/<redacted>/makeManifest.js:20:7)
  code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}

Image file: handset_icon@3x

System: OS: Ubuntu 18.04 bionic [Ubuntu on Windows 10] Kernel: x86_64 Linux 4.4.0-18362-Microsoft CPU: Intel Core i7-8565U @ 8x 2.001Ghz image-size version: 0.8.3 (npm)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
wouterlemckecommented, Aug 22, 2022

Unfortunately the Node upgrade did not solve the issue…

1reaction
wouterlemckecommented, Aug 16, 2022

We’re upgrading to Node 16. We hope this will also magically solve this issue. I will keep you posted

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Windows Subsystem for Linux | Microsoft Learn
Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
Read more >
FAQ's about Windows Subsystem for Linux - WSL
Find answers to frequently asked questions (FAQs) about the Windows Subsystem for Linux, such as 'What can I do with WSL?'.
Read more >
Manual installation steps for older versions of WSL
Step by step instructions to manually install WSL on older versions of Windows, rather than using the wsl install command.
Read more >
Advanced settings configuration in WSL - Microsoft Learn
A guide to the wsl.conf and .wslconfig files used for configuring settings when running multiple Linux distributions on Windows Subsystem ...
Read more >
Release Notes for WSL | Microsoft Learn
Make wsl.exe present when the Windows Subsystem for Linux optional component is not enabled to improve feature discoverability. Change wsl.exe ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found