Fujifilm has not published RAF. This page follows the libopenraw documentation, dcraw and ExifTool. The header and the metadata block are big-endian.
Header
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 16 | Signature | FUJIFILMCCD-RAW (with a final space) |
| 16 | 4 | Format version | ASCII digits, such as 0201 |
| 20 | 8 | Camera ID | An identifier of the model, such as FF389501 |
| 28 | 32 | Camera name | The model name, ended by a zero byte |
| 60 | 4 | Version | ASCII digits such as 0100; ExifTool reads it as the firmware version |
| 64 | 20 | – | Unknown |
| 84 | 4 | JPEG offset | Where the embedded JPEG starts |
| 88 | 4 | JPEG length | Its length |
| 92 | 4 | Metadata offset | Where the metadata block starts (see tags) |
| 96 | 4 | Metadata length | Its length |
| 100 | 4 | Raw offset | Where the raw section starts |
| 104 | 4 | Raw length | Its length |
| 108 | 4 | Compression | 0 uncompressed, 2 lossless compressed, 3 lossy compressed (newer cameras; ExifTool’s RAFCompression) |
| 112 | 8 | – | Unknown |
| 120 | 4 | Second metadata offset | In files with a second image (below); otherwise unused |
| 128 | 4 | Second raw offset | The raw section of the second image |
The JPEG offset is always past this table, so a reader can tell how long the header is from it. Offsets at 120 and beyond are only read when the JPEG starts after them.
dcraw confirms the offsets: it reads the JPEG offset and length at 84 and 88, the
metadata offset at 92, the raw (TIFF) offset at 100, and, only when the JPEG offset is
above 120, a second value at 120. For the second shot of a two-image file it reads the
raw offset at 128 (100 + 28) and, when the value at 120 is non-zero, parses a second
metadata block there. libopenraw lists the 12 bytes at 108 to 119 as unknown, and the
bytes at 64 to 83 likewise; ExifTool names the long at 108 as RAFCompression. The
version at 60 is 0100 or 0159 in libopenraw’s examples. The
raw section is a TIFF container, whose data may be compressed. When no loader is chosen
from the tags dcraw falls back to unpacked 14-bit data.
Sources
- libopenraw: RAF – header layout, the JPEG, metadata and CFA sections
- ExifTool: FujiFilm tags – FirmwareVersion at 60 and RAFCompression at 108
- dcraw.c (ncruces mirror) – the FUJIFILM branch of
identify, read as a description
Sections
| Section | Content |
|---|---|
| JPEG | An Exif JPEG with the preview and thumbnail. Its Exif data holds the Fujifilm maker note, and it may hold an XMP packet (cameras use it for the star rating). |
| Metadata | A count and a list of tagged records with the sensor size, crop, colour filter layout and white balance (see tags). |
| Raw | On most cameras a small TIFF structure whose IFD has a sub-IFD (tag 0xF000) with Fujifilm’s own tags pointing to the sensor data. Some older cameras lay this section out differently. |
Some Super CCD SR cameras recorded two images per shot, from the two kinds of photodiode on the sensor; the second set of offsets at 120 and 128 points to the second image.
The first bytes
00000000 46 55 4A 49 46 49 4C 4D 43 43 44 2D 52 41 57 20
00000010 30 32 30 31 46 46 33 38 39 35 30 31 …
FUJIFILMCCD-RAW , then version 0201 and camera ID FF389501