klauspost/rawspeed — pull request #34 by pedrocr (2014-08-11 22:02:54+00:00)
Title: CRW support

Support for the CIFF based Canon CRW format. This adds a CIFF parser to rawspeed and implements a CRW decoder based on the dcraw code. Support was added to the following cameras:

* D30, D60, 10D and 300D DSLRs
* Pro1, G1, G2, G3, G5 and G6 compacts
* S30, S40, S45, S50, S60, S70 compacts

I used the Adobe DNG converter and dngmeta.sh from darktable to create the cameras.xml entries. Several of the white and black points seem off though. Most other actual CRW cameras should be easy to add. rawsamples.ch has several .CRW files that don't seem to actually be the same format and won't work with this code. I suspect these are raw files created by cameras that didn't have raw to begin with and just had it retrofitted with things like CHDK.

So far the parser only works in little-endian architectures. As I commented on the PR for the BE rename I think we should handle this at FileMap/ByteStream level and make the TIFF and CIFF IFD and Entry classes architecture agnostic. It would avoid a bunch of duplication.