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

Black CMYK JEPGs in PDF with MIME data mode #1183

Open
pravdomil opened this issue Jun 21, 2018 · 0 comments
Open

Black CMYK JEPGs in PDF with MIME data mode #1183

pravdomil opened this issue Jun 21, 2018 · 0 comments

Comments

@pravdomil
Copy link
Contributor

pravdomil commented Jun 21, 2018

Bug

I want to embed cmyk images in pdf using img.dataMode = Image.MODE_MIME. That should take the image and embed it into pdf without any painting or editing. But all cmyk images are black.

JPG
img

PDF
image

Files
img.jpg.zip
out.pdf

Related issue #425

Steps to Reproduce

const { createCanvas, Image } = require("canvas")
const { writeFileSync, readFileSync } = require("fs")

const img = new Image()
img.dataMode = Image.MODE_MIME
img.src = readFileSync("img.jpg")

const canvas = createCanvas(200, 200, "pdf")
const ctx = canvas.getContext("2d")
ctx.drawImage(img, 50, 50, 100, 100)
writeFileSync("out.pdf", canvas.toBuffer())

Your Environment

  • Version of node-canvas: 2.0.0-alpha.12
  • Environment: node 10.1.0, macOS 10.13.5
@zbjornson zbjornson changed the title Black cmyk images in pdf with mime data mode Black CMYK JEPGs in PDF with MIME data mode Aug 31, 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

3 participants