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

Bring back CMYK JPEG support #337

Open
proverbian opened this issue Sep 12, 2018 · 4 comments
Open

Bring back CMYK JPEG support #337

proverbian opened this issue Sep 12, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request investigating Investigating the issue priority-low
Milestone

Comments

@proverbian
Copy link

Have an Error after running this:

htmldoc -t pdf --webpage --left 4 --right 7 --top 0 --bottom 0 --bodyfont Arial --fontsize 9 --headfootfont Verdana-Bold --headfootsize 1 -f PDF-test.pdf invoiceprintview.php

ERR007: CMYK JPEG files are not supported! (/images/rs_customers/logo/1/rs_logo.jpg)
ERR011: Unable to load image file "/images/rs_customers/logo/1/rs_logo.jpg"!
ERR007: CMYK JPEG files are not supported! (/images/rs_customers/logo/1/rs_logo.jpg)
ERR011: Unable to load image file "/images/rs_customers/logo/1/rs_logo.jpg"!

After converting the Image to RGB, its working fine.
Just wondering if why it doesn't support CMYK.

It was working fine when we are using 1.8.27

Thanks!

@michaelrsweet
Copy link
Owner

That’s because they were crashing htmldox (issue #6106)

@michaelrsweet
Copy link
Owner

Commit 530a587 on the old 1.8 branch covered the change...

@michaelrsweet
Copy link
Owner

OK, tracking this for a possible re-introduction of CMYK JPEG support. Will probably need to look for the Adobe APPE marker to know whether to invert the resulting RGB data from libjpeg (Adobe TN #5116) and add several CMYK JPEG test files. And that's assuming the current crashing issue in libjpeg is fixed... :/

@michaelrsweet michaelrsweet self-assigned this Sep 28, 2018
@michaelrsweet michaelrsweet added this to the Future milestone Sep 28, 2018
@michaelrsweet michaelrsweet changed the title ERR007: CMYK JPEG files are not supported version 1.9 Bring back CMYK JPEG support Sep 28, 2018
@michaelrsweet michaelrsweet added enhancement New feature or request investigating Investigating the issue labels Sep 28, 2018
@proverbian
Copy link
Author

Hey Michael,

Thanks for your reply.
We have a temporary solution about it.
We convert the actual image from CMYK to sRGB.

Code like this, for others to have an idea incase they encounter this.

// FIX CMYK Image issue
$upload_file = "image.jpg"
$icc_profile = "/home/user/path/sRGB.icc";
$check = shell_exec("identify -verbose $upload_file  | grep Colorspace  2>&1;");

$check = explode(":", $check);
$check = trim($check[1]);

 if ($check == 'CMYK') {
   $out = shell_exec("convert -verbose $upload_file -profile $icc_profile -colorspace sRGB  -compress LZW $upload_file 2>&1;");
 }

Downloaded sRGB.icc here: http://www.color.org/black_scaled_2009_srgb.xalter

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigating Investigating the issue priority-low
Projects
None yet
Development

No branches or pull requests

2 participants