Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA093DB3A for ; Tue, 4 Sep 2012 19:17:08 +0000 (UTC) Received: (qmail 27432 invoked by uid 500); 4 Sep 2012 19:17:08 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 27308 invoked by uid 500); 4 Sep 2012 19:17:08 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 27145 invoked by uid 99); 4 Sep 2012 19:17:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 19:17:07 +0000 Date: Wed, 5 Sep 2012 06:17:07 +1100 (NCT) From: "Damjan Jovanovic (JIRA)" To: issues@commons.apache.org Message-ID: <290307253.34370.1346786227950.JavaMail.jiratomcat@arcas> In-Reply-To: <831096160.2856.1343863863009.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (IMAGING-89) Detect the YCCK color space/type MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Damjan Jovanovic resolved IMAGING-89. ------------------------------------- Resolution: Fixed Fix Version/s: 1.0 I've just committed a fix for this to the latest SVN. Imaging.getImageInfo() will now distinguish the YCCK colorspace based on the App14 segment. Resolving fixed. > Detect the YCCK color space/type > -------------------------------- > > Key: IMAGING-89 > URL: https://issues.apache.org/jira/browse/IMAGING-89 > Project: Commons Imaging > Issue Type: New Feature > Components: Format: JPEG > Affects Versions: 1.x > Reporter: Arthur Bogaart > Priority: Minor > Fix For: 1.0 > > Attachments: test-YCCK.jpg > > > I use Sanselan/CommonsImaging to detect if uploaded images are in the RGB color space, and if not convert them to RGB. > Currently, CI marks jpg images in the YCCK color space as CMYK: > ImageInfo info = Imaging.getImageInfo(is, "YCCK.jpg"); > info.getColorType() == ImageInfo.COLOR_TYPE_CMYK > So I have to do a custom check afterwards to differ between YCCK and CMYK. > I use the following to do this: > import com.drew.imaging.jpeg.JpegSegmentReader; > JpegSegmentReader reader = new JpegSegmentReader(is); > byte[] appe = reader.readSegment(JpegSegmentReader.SEGMENT_APPE); > bool isYCCK = appe != null && appe[11] == 2; > Would it be possible to incorporate this into CommonsImaging? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira