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

Unable to read JPEG image: "IllegalArgumentException: Unknown color space" #93

Closed
mjball opened this issue Feb 4, 2015 · 3 comments
Closed

Comments

@mjball
Copy link

mjball commented Feb 4, 2015

Trying to read this image:

image

(original: http://pbs.twimg.com/profile_images/1251399177/Logo_600_kb.jpg)

I get this exception:

java.lang.IllegalArgumentException: Unknown color space
    at java.awt.color.ICC_Profile.iccCStoJCS(ICC_Profile.java:1774) ~[na:1.8.0_25]
    at java.awt.color.ICC_Profile.getColorSpaceType(ICC_Profile.java:1242) ~[na:1.8.0_25]
    at java.awt.color.ICC_Profile.getColorSpaceType(ICC_Profile.java:1233) ~[na:1.8.0_25]
    at java.awt.color.ICC_ColorSpace.<init>(ICC_ColorSpace.java:112) ~[na:1.8.0_25]
    at com.twelvemonkeys.imageio.color.ColorSpaces.getCachedOrCreateCS(Unknown Source) ~[redacted.jar:1.0-SNAPSHOT]
    at com.twelvemonkeys.imageio.color.ColorSpaces.createColorSpace(Unknown Source) ~[redacted.jar:1.0-SNAPSHOT]
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(Unknown Source) ~[redacted.jar:1.0-SNAPSHOT]
    at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source) ~[redacted.jar:1.0-SNAPSHOT]
    at javax.imageio.ImageIO.read(ImageIO.java:1448) ~[na:1.8.0_25]
    at javax.imageio.ImageIO.read(ImageIO.java:1352) ~[na:1.8.0_25]

Here's what exiftool has to say about the image:

ExifTool Version Number         : 9.76
File Name                       : unknown-color-space.jpg
Directory                       : .
File Size                       : 24 kB
File Modification Date/Time     : 2015:02:04 00:29:58-05:00
File Access Date/Time           : 2015:02:04 00:38:12-05:00
File Inode Change Date/Time     : 2015:02:04 00:33:17-05:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Current IPTC Digest             : ef444f77d0e828fe18ecc49329439244
Coded Character Set             : UTF8
Application Record Version      : 2
Object Name                     : Logo
IPTC Digest                     : ef444f77d0e828fe18ecc49329439244
Exif Byte Order                 : Big-endian (Motorola, MM)
Orientation                     : Horizontal (normal)
X Resolution                    : 300
Y Resolution                    : 300
Resolution Unit                 : inches
Software                        : Adobe Photoshop CS4 Macintosh
Modify Date                     : 2009:11:12 16:14:00
Color Space                     : Uncalibrated
Exif Image Width                : 3543
Exif Image Height               : 3549
Profile CMM Type                : ADBE
Profile Version                 : 2.1.0
Profile Class                   : Output Device Profile
Color Space Data                : GRAY
Profile Connection Space        : XYZ
Profile Date Time               : 1999:06:03 00:00:00
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : none
Device Model                    :
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Unknown (16777216)
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : ADBE
Profile ID                      : 0
Profile Copyright               : Copyright 1999 Adobe Systems Incorporated
Profile Description             : Dot Gain 20%
Media White Point               : 0.9642 1 0.82491
Media Black Point               : 0 0 0
Gray Tone Reproduction Curve    : (Binary data 524 bytes, use -b option to extract)
XMP Toolkit                     : XMP Core 4.4.0
Title                           : Logo
Image Width                     : 499
Image Height                    : 500
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 1
Image Size                      : 499x500

Any ideas on what's going wrong here? Thanks for providing this fantastic library.

@haraldk haraldk added this to the 3.1 milestone Feb 4, 2015
@haraldk haraldk self-assigned this Feb 4, 2015
@haraldk
Copy link
Owner

haraldk commented Feb 4, 2015

Hi Matt,

Thanks for reporting!

This is a known issue with the 3.0.x versions, it does not fully support the new default color managment system in Java 8 (LCMS). The issue is fixed in 3.1 (to be released soon).

You can work around the issue for now, using the -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvidersystem property (effectively reverting to the old Kodak CMS that has been the default in previous versions) or alternatively build your own 3.1 snapshot.

Feel free to reopen the issue, if you have further problems/comments. :-)

Best regards,

Harald K

@haraldk haraldk closed this as completed Feb 4, 2015
@mjball
Copy link
Author

mjball commented Feb 4, 2015

Thanks so much, Harald.

What do you think of making a label so this sort of "known issue" is discoverable without having to bother you?

@haraldk
Copy link
Owner

haraldk commented Feb 5, 2015

Hi again,

Don’t worry, I’m not bothered at all. Personally I think it’s fine to answer a few questions like this, because it gives me some feedback on how people use the library, what versions they are running on etc. The current load is one or two issues a week on average, so I can handle it. :-)

However, I understand it might be useful for others to see what known issues exists. The only problem I see, is that all the issues in the tracker are “known issues” for some version. The known issues for a given version isn’t static like a tag, it’s more like a filter (for version x, give me all issues reported against a version lower or equal to x, that are either still open or closed for a version higher than x). And the GitHub issue tracker seems a little simplistic for this. I’m open for suggestions here, though.

Best regards,

Harald K

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

2 participants