unity resource_error ai_generated true

导入资源失败: 'Assets/Textures/photo.cr2'。错误: 无法解码原始图像数据

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

ID: unity/asset-import-cr2-raw-not-supported

其他格式: JSON · Markdown 中文 · English
95%修复率
90%置信度
1证据数
2023-11-12首次发现

版本兼容性

版本状态引入弃用备注
Unity 2021.3 active
Unity 2022.3 active
Unity 2023.2 active

根因分析

Unity的纹理导入器不支持佳能CR2原始图像格式;它期望标准格式如PNG、JPG、TGA或EXR。

English

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

generic

官方文档

https://docs.unity3d.com/Manual/ImportingTextures.html

解决方案

  1. 使用外部工具如Adobe Photoshop、GIMP或ImageMagick将CR2文件转换为支持的格式(如PNG、JPG或EXR)。命令示例:magick convert photo.cr2 photo.png
  2. 如果需要原始图像用于高动态范围,转换为EXR或HDR格式而不是PNG/JPG以保留数据。
  3. 使用自定义导入器或脚本,通过第三方库(如LibRaw)在运行时加载CR2文件,完全绕过Unity的导入管线。

无效尝试

常见但无效的做法:

  1. 98% 失败

    Renaming does not change the internal file format; Unity will still attempt to decode the raw data and fail with a similar error.

  2. 90% 失败

    Unity does not use system codecs for texture import; it relies on built-in decoders for supported formats only.

  3. 95% 失败

    Re-saving in the same format does not change the encoding; Unity still cannot decode it.