[jira] [Created] (IMAGING-89) Detect the YCCK color space/type

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
Arthur Bogaart created IMAGING-89:
-------------------------------------

             Summary: 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


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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arthur Bogaart updated IMAGING-89:
----------------------------------

    Attachment: test-YCCK.jpg

Attached YCCK test image
               

> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

     [ 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456873#comment-13456873 ]

Arthur Bogaart commented on IMAGING-89:
---------------------------------------

Great stuff, thanks Damjan!
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457367#comment-13457367 ]

Manuel Bleichenbacher commented on IMAGING-89:
----------------------------------------------

In order to determine whether inverted values are used or not (for CMYK and YCCK values), I need to check whether the APP14 segment is present or not. Thus, the new extension does not really simplify my code as I still need to use the JpegSegmentReader directly.
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457582#comment-13457582 ]

Damjan Jovanovic commented on IMAGING-89:
-----------------------------------------

Well assuming you're unhappy with:

{code}
List<Segment> segments = jpegImageParser.readSegments(byteSource,
                new int[] { JPEG_APP14_Marker, }, false);

if ((segments == null) || (segments.size() < 1)) {
    // No APP14
} else {
    // ...
}
{code}

what API would you propose instead?

               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IMAGING-89) Detect the YCCK color space/type

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ https://issues.apache.org/jira/browse/IMAGING-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458975#comment-13458975 ]

Manuel Bleichenbacher commented on IMAGING-89:
----------------------------------------------

The ideal solution would be to have a JpegImageInfo class (subclass of ImageInfo) containing a flag indicating whether inverted values are used. Instance of this class would be returned by Imaging.getImageInfo. The new class could contain further JPEG specific fields. It's somewhat similar to PngImageInfo.

But to be honest, it's not utterly important. I can live with the current solution.

               

> 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