Pure Java alternative to JAI ImageIO for detecting CMYK images

后端 未结 4 842
忘了有多久
忘了有多久 2020-12-24 15:24

first I\'d like to explain the situation/requirements that lead to the question:

In our web application we can\'t support CMYK images (JPEG) since IE 8 and below can

4条回答
  •  长发绾君心
    2020-12-24 15:52

    In our web application we can't support CMYK images (JPEG) since IE 8 and below can't display them. Thus we need to detect when someone wants to upload such an image and deny it.

    I don't agree with your "Thus we need to detect when someone wants to upload such an image and deny it". A much more user-friendly policy would be to convert it to something else than CMYK.

    The rest of your post is a bit confusing in that regards seen that you ask both for detection and conversion, which are two different things. Once again, I think converting the image is much more user-friendly.

    No need to write in bold btw:

    Is there any pure Java alternative to JAI ImageIO which reliably detects and possibly converts CMYK images?

    Pure Java I don't know, but ImageMagick works fine to convert CMYK image to RGB ones. Calling ImageMagick on the server-side from Java really isn't complicated. I used to do it manually by calling an external process but nowadays there are wrappers like JMagick and im4java.

提交回复
热议问题