[Geopackage] Displaying Geopackage Raster data (Even Rouault)

Pepijn Van Eeckhoudt pepijn at vaneeckhoudt.net
Tue Jun 23 11:43:56 EDT 2015

> I'm not 100% clear on what the actual issue is here. Is there a problem with the spec? If so, please write up a ticket and I will make sure the SWG takes a look at it.
> https://github.com/opengeospatial/geopackage/issues <https://github.com/opengeospatial/geopackage/issues>
> Thanks,
> Jeff

Hi Jeff,

I believe this is related to https://github.com/opengeospatial/geopackage/issues/104 <https://github.com/opengeospatial/geopackage/issues/104>. The images in the ERDC file are 4 channel CMYK ones. Strictly speaking these are not valid JFIF files since JFIF requires 1 (Y) or 3 channel (YCbCr) images and specifies the RGB <-> YCbCr conversion formulas that should be used.

I’ve extracted and attached one of the images from the dataset <https://cloud.githubusercontent.com/assets/225326/8309554/6187e18c-19cb-11e5-9713-7d0f8143c8be.jpg> and attached it to the linked issue. That hopefully makes it a bit easier to analyse. I also dumped the metadata from that file using JPEGsnoop (see below). That clearly shows this being a 4 channel image.

CMYK in JPEG seems to be an Adobe specific extension. Looking through the libjpeg code (see jdapimin.c#default_decompress_parms) it recognises a JPEG as being CMYK if it has 4 channels and contains an Adobe specific bit of metadata in an APP14 segment. The best spec I could find for this is http://www.aiim.org/documents/standards/PDF-Ref/References/Adobe/5116.DCT_Filter.pdf <http://www.aiim.org/documents/standards/PDF-Ref/References/Adobe/5116.DCT_Filter.pdf> which was referenced from https://issues.apache.org/jira/browse/IMAGING-89 <https://issues.apache.org/jira/browse/IMAGING-89>

For maximum interoperability, GeoPackage should probably stick to JFIF, but that’s just my 2 cents.



JPEGsnoop 1.7.3 by Calvin Hass

*** Marker: SOF0 (Baseline DCT) (xFFC0) ***
  OFFSET: 0x0000008C
  Frame header length = 20
  Precision = 8
  Number of Lines = 256
  Samples per Line = 256
  Image Size = 256 x 256
  Raw Image Orientation = Landscape
  Number of Img components = 4
    Component[1]: ID=0x01, Samp Fac=0x22 (Subsamp 1 x 1), Quant Tbl Sel=0x00 (C)
    Component[2]: ID=0x02, Samp Fac=0x11 (Subsamp 2 x 2), Quant Tbl Sel=0x01 (M)
    Component[3]: ID=0x03, Samp Fac=0x11 (Subsamp 2 x 2), Quant Tbl Sel=0x01 (Y)
    Component[4]: ID=0x04, Samp Fac=0x22 (Subsamp 1 x 1), Quant Tbl Sel=0x00 (K)

 <https://cloud.githubusercontent.com/assets/225326/8309554/6187e18c-19cb-11e5-9713-7d0f8143c8be.jpg> <https://cloud.githubusercontent.com/assets/225326/8309554/6187e18c-19cb-11e5-9713-7d0f8143c8be.jpg>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengeospatial.org/pipermail/geopackage/attachments/20150623/5b8e03f8/attachment.html>

More information about the Geopackage mailing list