Automattic/node-canvas
View on GitHubloadImage() unable to read file with non-ANSI filepath.
Open
#1979 opened on Feb 2, 2022
3 comments (3 comments)0 reactions (0 reactions)0 assignees (0 assignees)JavaScript9,524 stars (9,524 stars)1,140 forks (1,140 forks)batch import
BugHelp wanted
Description
As described in title. OS:windows
Contributor guide
- Tech stack
- javascriptcppnodejs
- Domain
- backend
- Issue type
- bug
- DifficultyEstimated implementation difficulty for a new contributor, from 1 for very small changes to 5 for expert-level work.
- 3
- Estimated timeA rough time range for an experienced contributor to investigate, implement, test, and prepare a pull request.
- half day
- Activity statusHow available the issue appears right now: fresh, active, stale, blocked, or waiting on maintainer input.
- fresh
- ClarityHow clearly the issue explains the expected change, acceptance criteria, and next step.
- needs investigation
- Prerequisites
- Node.js basicsFamiliarity with Windows file pathsC++ basics
- Newbie friendlinessA 1-100 score estimating how approachable this issue is for first-time contributors.
- 30
- Research direction
- The issue is that loadImage() fails for non ANSI filepaths on Windows. Look at the C++ source code for image loading, likely in src/Canvas.cc or Image.cc, to see how the file path is converted from JavaScript string to native. Check if there's use of ASCII only functions or if UTF 8 encoding is handled. Also review any existing PRs or comments in the issue for clues. A fix might involve using WideCharToMultiByte to handle Unicode paths on Windows.