Skip to content

loadImage fails with "Invalid SOS parameters for sequential JPEG" #1235

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

Open
dmbfm opened this issue Aug 31, 2018 · 3 comments
Open

loadImage fails with "Invalid SOS parameters for sequential JPEG" #1235

dmbfm opened this issue Aug 31, 2018 · 3 comments

Comments

@dmbfm
Copy link

dmbfm commented Aug 31, 2018

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 {
  <rejected> 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 (<anonymous>)
    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 (<anonymous>)
    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
@ghost
Copy link

ghost commented Aug 31, 2018

Your image is not publicly accessible. Please upload it to github or somewhere else, so that people can see it.

@ghost
Copy link

ghost commented Sep 6, 2018

Why have you removed the image? How can anyone reproduce the issue now? Here is your image, if you don't want me to share it, let me know and I'll remove it. But in that case, please find another example that reproduces the issue.

Tested with latest version of node and node-canvas and got the following error:

(node:3556) UnhandledPromiseRejectionWarning: Error: Unsupported marker type 0xf9

@dmbfm
Copy link
Author

dmbfm commented Sep 12, 2018

@ghost sorry, had to remove the image at the request of a client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants