November 30, 2026
How to Check a RAW File’s Decode Mode Before You Build an Upload Flow
Check a camera RAW file’s exact decode mode before an upload flow promises sensor data, previews, or a rendered image.
A .CR3, .NEF, or .DNG extension is not enough to promise that your upload flow can decode a customer’s sensor data. Check the exact format and mode first, then decide whether to offer a full decode, a clearly labeled embedded preview, or a stop message. You need a representative set of camera files and the FlashRaw CLI; do this before connecting a browser preview or catalog-import screen to production.
This matters because a RAW container can hide materially different compression, bit-depth, crop, burst, or calibration modes. FlashRaw’s format matrix tracks support at that level, not simply by filename extension. A file that opens is not automatically a file whose sensor pixels, metadata, and display rendering meet your product’s promise.

1. Write the promise your upload flow is allowed to make
Start with one output contract per route. For a supplier-photo intake, these are usually different products:
| Reader-facing result | What your service must have | Safe message |
|---|---|---|
| Technical validation | Container recognition and metadata | “We identified this camera file; review its details.” |
| Editing or conversion | Full sensor decode and the intended colour path | “We decoded the RAW sensor data.” |
| Fast visual triage | An embedded camera preview | “This is the camera’s embedded preview, not a developed RAW render.” |
Do not collapse these outcomes into “RAW supported.” If a merchandising team needs a trustworthy image for a Shopify listing, treat a preview as a review aid, not proof that your final renderer will match it. That same distinction keeps a private browser RAW previewer honest about what happens on the device.
2. Inspect the project’s support matrix before testing a file
Install the CPU CLI, then print the published matrix:
cargo install flashraw-cli
flashraw supported
The command-line tool is a useful first gate because the matrix labels modes as verified, partial, experimental, or unsupported. A verified row has representative corpus coverage, pinned output hashes, metadata checks, and corruption handling; partial and experimental rows carry important limitations. Use the matrix to form a test hypothesis, not as a substitute for your own camera files.
If your service accepts JPEG XL–compressed DNG or needs the optional GPU path, install the feature build documented by the project instead:
cargo install flashraw-cli --features gpu,jpegxl
The right expected result is a written list of the exact camera/model/mode combinations your team will accept. “DNG” alone is not a useful acceptance criterion.
3. Capture metadata without accidentally doing a full conversion
For each candidate upload, record a compact intake receipt before you wire up an expensive decode:
flashraw info supplier-photo.CR3 --json
flashraw dump-metadata supplier-photo.CR3 > supplier-photo.metadata.json
Keep the original file immutable and store the receipt beside the job record. At minimum, preserve the file hash, camera make/model, dimensions, CFA (colour filter array) layout, black and white levels, white balance, orientation, crop, and the observed support status. Those facts tell an engineer what the sensor samples mean; they are not interchangeable with a browser thumbnail.
A practical receipt also includes the desired output (sensor, RGBA8, or preview), the FlashRaw version, and the exact command. This is the same release discipline that makes a Shopify image URL and alt-text check easier to reproduce later: leave evidence for the next person, not just a green status.

4. Make the fallback boundary explicit
Now run a small, representative decode test. Ask for the output your product actually needs—not a generic success signal:
flashraw decode supplier-photo.NEF proof.jpg --output rgba8 --profile
flashraw preview supplier-photo.NEF embedded-preview.jpg
Compare the outcomes using this decision rule:
- Full decode succeeds: allow the route that needs sensor data or a developed image, then run your normal fidelity checks.
- Only the embedded preview is usable: allow a preview-only route and mark the image source as camera-rendered. Do not silently send it to a workflow that advertises RAW development.
- The mode is partial, experimental, or fails: stop the automated route, retain the diagnostic receipt, and ask for a supported original or a reviewed conversion.
FlashRaw documents a preview_fallback option for display-oriented outputs when sensor decoding is unavailable. It explicitly marks that result as a camera 8-bit preview; raw outputs and regions do not fall back. That makes it useful for a clearly labeled triage screen, not for hiding a compatibility gap. If the screen must stay responsive while performing the real work, apply the worker boundary from How to Keep a Browser RAW Preview Responsive With a Web Worker.
5. Test the mode you will actually receive
Build a small fixture set from lawful files your customers genuinely upload. Include at least one normal file for each promised camera family, plus a large file, a compressed variant, and one known rejection. For every fixture, assert the following:
flashraw infoidentifies the expected format and metadata.- The intended decode command either produces the requested output or fails with a reviewable error.
- Your UI labels a preview fallback differently from a full decode.
- Your queue limits file size and handles corrupt or truncated input without presenting a false success.
- A record contains the file hash, decoder version, mode, result, and reviewer decision.
This is deliberately smaller than a universal performance claim. FlashRaw publishes reproducible benchmarks, but they measure specific machines, files, output paths, and versions. Measure your own latency and memory budget only after the compatibility contract is correct.

6. Ship the receipt with the handoff
Before enabling a new supplier or camera family, save one six-line release receipt: input camera/mode, FlashRaw version, expected output, fixture result, fallback behavior, and owner. It gives support and operations a concrete answer when an upload is rejected or when a customer sees a preview that differs from a final image.
The next action is simple: run flashraw supported, choose one real file from your intake queue, and write its allowed outcome before you build the upload UI. Start with the FlashRaw documentation and browser demo to inspect the available integration paths, then make the promise in your product copy match the mode you actually tested.