Automattic / Automattic/node-canvas
loadImage fails with "Invalid SOS parameters for sequential JPEG"
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue or Feature
I'm having a problem trying to loading a jpeg image using the `loadImage` method:
```
> canvas.loadImage('./c.jpeg')
Invalid SOS parameters for sequential JPEG
Promise {
Error: error while reading from input stream
at Image.set (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/lib/image.js:55:21)
at Promise (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/index.js:34:15)
at new Promise ()
at Object.loadImage (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/index.js:23:10)
at repl:1:8
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10),
domain:
Domain {
domain: null,
_events: { error: [Function: debugDomainError] },
_eventsCount: 1,
_maxListeners: undefined,
members: [] } }
> (node:22155) UnhandledPromiseRejectionWarning: Error: error while reading from input stream
at Image.set (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/lib/image.js:55:21)
at Promise (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/index.js:34:15)
at new Promise ()
at Object.loadImage (/home/dmbfm/Projects/Tests/node-canvas-bug/node_modules/canvas/index.js:23:10)
at repl:1:8
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:468:10)
(node:22155) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22155) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```
If I load the image using ImageMagick I get a similar warning, with the additional info of `Unsupported marker type 0xf9` but the image loads.
## Steps to Reproduce
Load this image using the `loadImage` method or setting `src` property in the `Image` object.
## Your Environment
* Version of node-canvas: 2.0.0-alpha.13
* Environment: node v8.11.4, Ubuntu 18.04 / Macos 10.13.5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.