-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
vips_colourspace: no known route between 'cmyk' and 'srgb' #99
Comments
Good spot, definitely a bug, thanks for reporting. This module borrows extensively from |
Hi @jeromegv, are you able to check this problem is fixed for you when using the work-in-progress
|
Hi @lovell , thanks for the quick answer. So yes, it is now resizing. Here's what I used |
Thank you for checking this. This yellow problem you're seeing is very likely to be related to the new |
I've moved the sRGB colour space conversion, if required, to occur sooner. I've added a test for this - are you able to retest too? I also noticed my original fix for this had negative performance implications so it's a good thing you spotted this! |
I confirm, that worked! No more yellow and the resize happens, seems fixed! Thanks a lot again |
Brilliant, thanks for verifying this works Jérôme. The fix will be included in the forthcoming v0.7.0 release. |
I still have this issue on v0.7.1. However, I am still using libvips 7.40.2. @lovell Does your fix require an update to libvips beyond my version as well? Thanks again for all of your assistance! |
@bradisbell The fix was to this module so should work with libvips 7.40.2. Are you able to provide an example image that generates this error? |
DropBox link in case GitHub decides to do something to the image: https://www.dropbox.com/s/026tppp744dmjbk/raw%20(7).jpg?dl=1
|
@bradisbell This seems to be a JPEG image in a non sRGB colourspace (namely CMYK) but without an ICC colour profile. I'd expect Could it have passed through an overly-zealous metadata stripping tool? |
@lovell I wouldn't be surprised if many of the photos I need to resize were passed through a meat grinder before reaching my code. :-) I am unable to control the source. Is there any way to set a default ICC profile? Unfortunately, I'm in a situation where if the photo can be handled at all, it must be, even if quality of color is lost. The expectation is that if a browser or photo viewer can render it, I should be able to resize it. |
The most common ICC profile for CMYK is "US Web Coated (SWOP) v2" so would make a sensible default. I can add the relevant 545KB file to this module then use it for the colour space conversion of any 4 channel JPEG without an embedded ICC profile. The profile will be loaded from disk only when needed, so there will be a slight performance hit for the first image of this nature.
By way of example, Chrome uses Skia under the hood for this sort of thing. The source code reveals:
This proposed addition to |
I've added support to the master branch for CMYK input images without an embedded profile. @bradisbell Are you able to test using |
@lovell Your update resolved my issue perfectly. Thank you! As a bonus, your profile does indeed do a much better job at handling CMYK images than what is built into Chrome. |
Great news, thanks for confirming. I'll publish v0.7.2 to If you're able to share, a few details about your use of this module would be most welcome over at #35. |
Hi
I'm trying to resize an image with sharp and I get this error:
vips_colourspace: no known route between 'cmyk' and 'srgb'
vips_image_pio_input: no image data
I'm using vips: stable 7.40.10 (installed with homebrew on mac)
The image is here:
https://infinitely-production.s3.amazonaws.com/uploads/assets/attachment/5187ae04f3317f2f1f00164a/Jacinto_Lirio_kwaderno.jpg
Here's the full metadata of the image
identify -verbose Jacinto_Lirio_kwaderno.jpg
Image: Jacinto_Lirio_kwaderno.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 4961x3508+0+0
Resolution: 300x300
Print size: 16.5367x11.6933
Units: PixelsPerInch
Type: ColorSeparation
Endianess: Undefined
Colorspace: CMYK
Depth: 8-bit
Channel depth:
cyan: 8-bit
magenta: 8-bit
yellow: 8-bit
black: 8-bit
Channel statistics:
Pixels: 17403188
Cyan:
min: 0 (0)
max: 100 (0.392157)
mean: 3.0409 (0.0119251)
standard deviation: 16.4575 (0.0645393)
kurtosis: 25.6952
skewness: 5.25657
Magenta:
min: 0 (0)
max: 135 (0.529412)
mean: 4.28151 (0.0167902)
standard deviation: 23.1797 (0.0909008)
kurtosis: 25.6952
skewness: 5.25664
Yellow:
min: 0 (0)
max: 255 (1)
mean: 8.29823 (0.0325421)
standard deviation: 44.9226 (0.176167)
kurtosis: 25.6945
skewness: 5.25658
Black:
min: 0 (0)
max: 49 (0.192157)
mean: 1.50316 (0.00589474)
standard deviation: 8.13645 (0.0319076)
kurtosis: 25.6944
skewness: 5.2565
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 4.28095 (0.016788)
standard deviation: 26.8905 (0.105453)
kurtosis: 61.5876
skewness: 7.59952
Total ink density: 209.02%
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: cmyk(255,255,255,0)
Border color: cmyk(223,223,223,0)
Matte color: cmyk(189,189,189,0)
Transparent color: cmyk(0,0,0,0)
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 4961x3508+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 99
Orientation: Undefined
Properties:
date:create: 2014-10-04T12:55:45-04:00
date:modify: 2013-05-06T09:20:13-04:00
jpeg:colorspace: 4
jpeg:sampling-factor: 1x1,1x1,1x1,1x1
signature: e2bee6d037910f0b23db5881471ba9e735bfa6e1ac26fad8a6eda20a1b277ed2
Profiles:
Profile-8bim: 28 bytes
Profile-icc: 557168 bytes
Artifacts:
filename: Jacinto_Lirio_kwaderno.jpg
verbose: true
Tainted: False
Filesize: 2.595MB
Number pixels: 17.4M
Pixels per second: 47.04MB
User time: 0.370u
Elapsed time: 0:01.370
Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-08-31 http://www.imagemagick.org
I've seen a similar bug to that on libvips tracker, but it's apparently already fixed (and it was affecting vipsthumbnail which I don't think is what we use here)
https://github.com/jcupitt/libvips/issues/152#issuecomment-57929979
The text was updated successfully, but these errors were encountered: