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

Problem rendering images with CMYK colorspace #315

Closed
garnieretienne opened this issue May 16, 2016 · 3 comments
Closed

Problem rendering images with CMYK colorspace #315

garnieretienne opened this issue May 16, 2016 · 3 comments
Labels
bug Existing features not working as expected

Comments

@garnieretienne
Copy link

garnieretienne commented May 16, 2016

Problem:

When using images with the CMYK colorspace, the color are changed (like a dark background).

Sample image (from google image):

Sample CMYK

Sample HTML:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Test CMYK</title>
    <style>
      @page {
        size: 6in 9in;
        margin: 0;
      }

      .image {
        max-width: 100%;
        max-height: 100%;
      }
    </style>
  </head>
  <body>
    <img class="image" src="http://towerofbabel.free.fr/test/SLW_LOGO_CMYK.jpg" alt="CMYK Test Image" />
  </body>
</html>

Sample command:

weasyprint test.html test.pdf

Result:

html_pdf

System:

Ubuntu 14.04 / WeasyPrint version 0.27
Edit: Ubuntu 16.04 / Weasyprint version 0.28 affected too

Anyone having this problem too?

@liZe
Copy link
Member

liZe commented May 16, 2016

I can reproduce and the problem appears with all my PDF readers, but it doesn't appear when you generate a PNG. It looks like a problem in the way Cairo embeds CMYK images in PDF files.

@liZe liZe added the bug Existing features not working as expected label May 16, 2016
@garnieretienne
Copy link
Author

Converting to RGB colorspace works too, (convert cmyk.jpg -colorspace RGB cmyk2.jpg) but I'm not sure I can modify our user images (our PDF files are provided to print services).

@liZe
Copy link
Member

liZe commented Oct 19, 2017

It was a bug in Cairo and it's been fixed in 1.15.4 (commit b207a932a2d3740984319dffd58a0791580597cd).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants