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
image/jpeg: support for CMYK images #4500
Comments
Labels changed: added priority-later, removed priority-triage. Owner changed to @nigeltao. Status changed to Accepted. |
Not sure what created this particular image, but I imagine software like Adobe Illustrator and other apps meant for printed design would produce CMYK. This image comes from a user's avatar on a service I run. It's using Go for the dynamic resizing proxy to serve the avatar images. |
Since the Go library treats YCbCr as a full-fledged color format (rather than as an internal part of a compression algorithm for RGB images), for consistency the example image above should probably be called "YCCK", not "CMYK". Raw CMYK and raw RGB JPEG images do exist. They are rare, but are widely supported by viewers. If YCCK support is being considered, I suggest that CMYK and RGB be considered as well. RGB JPEGs can be created with the -rgb option of the cjpeg utility included with libjpeg 8d. |
Here's another example image that causes this error. Would love to see more extensive image decoding support. We're using Go to resize and crop user-provided images. Attachments:
|
Another sample image, that fails to convert with "unsupported JPEG feature: SOF has wrong length" error Attachments:
|
I think google converted image above, so this is the original https://www.dropbox.com/s/2kjzt903pup7t2y/porsche-cayman-2013-3_0.jpg |
Comment 15 by alexander.lobunets: Yet another example of getting: ... value jpeg.UnsupportedError = "bad Pq value" ("unsupported JPEG feature: bad Pq value") Attachments:
|
Here's another example: http://demjjtnflw8t9.cloudfront.net/2dfcfeb5-5e5b-49b6-ad74-5c4fb47d8581 |
Comment 21 by remco.verhoef.red5: I've made a very basic additional implementation of CMYK to the default image library. No ICC or whatever, just plain CMYK. https://github.com/nl5887/golang-image |
Comment 23 by xing@fictionpress.com: We are getting this problem as well. |
alexander.lobunets: the "bad Pq value" is a different issue, #9888. |
@nigeltao So, if I |
CMYK decoding works with the latest (unstable) release of the standard library, which is due to be released as Go 1.5 on August 1. If you need it before then, you should be able to fork the image/... packages from 1.5 and run them on 1.4. If you are on 1.4, though, it won't be as easy as running "go get", since image/jpeg, image/color and image are part of the standard library. |
@nigeltao Yeah, I wasn't sure if the std lib was tightly versioned with the Go runtime or not. Not a major issue, but I'll definitely try out the CMYK support when Go 1.5 drops. Thanks so much for this improvement! |
by samuel.stauffer:
Attachments:
The text was updated successfully, but these errors were encountered: