Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-89

Detect the YCCK color space/type

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.x
    • 1.0-alpha1
    • Format: JPEG
    • None

    Description

      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?

      Attachments

        1. test-YCCK.jpg
          1012 kB
          Arthur Bogaart

        Activity

          People

            Unassigned Unassigned
            a.bogaart Arthur Bogaart
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: