Skip to content
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

CMYK JPEG images are not properly painted #425

Closed
bimusiek opened this issue May 21, 2014 · 9 comments
Closed

CMYK JPEG images are not properly painted #425

bimusiek opened this issue May 21, 2014 · 9 comments

Comments

@bimusiek
Copy link

So here is example of CMYK Jpeg that we try just to draw on canvas in nodejs.
logo-neu-fl-01-unsharp

And here is an result of it.
screenshot 2014-05-21 13 04 50

Code that I am using:

        this.context.drawImage(this.imageObj, imageX, imageY, imageWidth, imageHeight);

I would suggest to return exception that JPEG CMYK is not supported.

@somecodemonkey
Copy link

+1

@imjared
Copy link

imjared commented Apr 27, 2015

Did either of you find a way around this? This is looking like a pain point for my application.

@bimusiek
Copy link
Author

We changed our backend to convert CMYK to RGB before sending it to NodeJS.

@jakeg
Copy link
Contributor

jakeg commented Apr 28, 2015

I also experience this problem but we have very few customers using CMYK images so it's not a priority for us at the moment.

@vasili-zolotov
Copy link

+1 Just spent the day tracing the issues through the processing pipeline and all signs point to this as the root cause.

@jakeg jakeg mentioned this issue Apr 15, 2016
@jakeg
Copy link
Contributor

jakeg commented Sep 11, 2016

Happy to offer a bounty for anyone who wants to add support for CMYK jpgs.

@bruceCzK
Copy link

I'm facing the same issue, and I just use gm to convert images to RGB colorspace using following function. Make sure gm installed first.

const gm = require('gm')

function convertToRGB(file) {
  return new Promise((resolve, reject) => {
    gm(file).colorspace('RGB').toBuffer((err, buffer) => {
      if (err) {
        return reject(err)
      }
      resolve(buffer)
    });
  });
}

@bhouston
Copy link

This is also affecting YCCK images. Add this so that this thread appears in searches for the YCCK keyword.

@vlad-dudu
Copy link

Has anyone managed to find a solution for this issue besides converting the image to RGB prior to sending it to node canvas?

@zbjornson zbjornson added the Bug label Jun 19, 2018
@zbjornson zbjornson changed the title CMYK images are not properly painted CMYK JPEG images are not properly painted Aug 31, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit to zbjornson/node-canvas that referenced this issue Sep 9, 2018
zbjornson added a commit that referenced this issue Sep 13, 2018
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

9 participants