# Failed to import asset: 'Assets/Textures/photo.cr2'. Error: Could not decode raw image data

- **ID:** `unity/asset-import-cr2-raw-not-supported`
- **Domain:** unity
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

Unity's texture importer does not support Canon CR2 raw image format; it expects standard formats like PNG, JPG, TGA, or EXR.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2021.3 | active | — | — |
| Unity 2022.3 | active | — | — |
| Unity 2023.2 | active | — | — |

## Workarounds

1. **Convert the CR2 file to a supported format (e.g., PNG, JPG, or EXR) using an external tool like Adobe Photoshop, GIMP, or ImageMagick. Command example: magick convert photo.cr2 photo.png** (95% success)
   ```
   Convert the CR2 file to a supported format (e.g., PNG, JPG, or EXR) using an external tool like Adobe Photoshop, GIMP, or ImageMagick. Command example: magick convert photo.cr2 photo.png
   ```
2. **If the raw image is needed for high-dynamic-range, convert to EXR or HDR format instead of PNG/JPG to preserve data.** (90% success)
   ```
   If the raw image is needed for high-dynamic-range, convert to EXR or HDR format instead of PNG/JPG to preserve data.
   ```
3. **Use a custom importer or script that loads the CR2 file via a third-party library (e.g., LibRaw) at runtime, bypassing Unity's import pipeline entirely.** (70% success)
   ```
   Use a custom importer or script that loads the CR2 file via a third-party library (e.g., LibRaw) at runtime, bypassing Unity's import pipeline entirely.
   ```

## Dead Ends

- **** — Renaming does not change the internal file format; Unity will still attempt to decode the raw data and fail with a similar error. (98% fail)
- **** — Unity does not use system codecs for texture import; it relies on built-in decoders for supported formats only. (90% fail)
- **** — Re-saving in the same format does not change the encoding; Unity still cannot decode it. (95% fail)
