原始图像应使用哪种 MIME 类型?
Which MIME type should be used for a raw image?
Raw images 由照相机、扫描仪等生成,通常比 JPEG 图像给您更多 post 处理灵活性。
如果我从我的网络服务器提供这种文件,我应该使用哪种媒体类型(a.k.a。MIME 类型)? 我特别对最近佳能相机产生的 CR2 文件感兴趣,但答案也可能涉及 Adobe 的数字负片 (DNG) 格式或来自其他制造商相机的原始文件。 (我在 this list from the IANA 中没有看到任何相关内容。)
对于问题的作者来说可能为时已晚,但可能对其他遇到同样问题的人有所帮助。
对于 .CR2
是 image/x-dcraw
。
对于.DNG
是image/x-adobe-dng
根据(已解散?)GNOME RAW Thumbnailer 项目的 this XML file,原始图像的 MIME 类型通常为 image/x-dcraw。按文件扩展名列出,以下是该文件中提到的其他文件类型:
- ARW:image/x-sony-arw
- CR2:image/x-canon-cr2
- CRW:image/x-canon-crw
- DCR:image/x-kodak-dcr
- DNG:image/x-adobe-dng
- ERF:image/x-epson-erf
- K25: image/x-kodak-k25
- KDC:image/x-kodak-kdc
- MRW:image/x-minolta-mrw
- NEF:image/x-nikon-nef
- ORF: image/x-olympus-orf
- PEF:image/x-pentax-pef
- 英国皇家空军:image/x-fuji-raf
- RAW:image/x-panasonic-raw
- SR2:image/x-sony-sr2
- SRF:image/x-sony-srf
- X3F: image/x-sigma-x3f
使用约定Gnome raw thumbnailer might be an option but MIME is assigned by IANA based on reference standards and/or requests of the vendors, so is certainly a non-uffical way even though these are the MIME the vendors are using. The list of official IANA MIME can be found here. All the other list are actually unofficialial. Also, the Wikipedia list经常不更新
如果 MIME 不在列表中,您可以使用 exiftool 等工具提取它并查找 MIME 类型。
我也会考虑使用 application/octet-stream
,这是一种官方 MIME 类型,用于未知类型的二进制数据,如 RFC 2046 中所述,至少应用程序会知道它是一个二进制文件。
如果您不喜欢此解决方案或供应商使用的 MIME,并且需要消除多个 RAW 图像文件的歧义,我会遵循标准中用于其他专有图像类型的约定:image/vnd.<manufacturer>.<filename extension>
例如 Nikon 公司的 NEF 和 Minolta 的 .mrv:
image/vnd.nikon.nef
image/vnd.minolta.mrw
但这当然是纯粹的猜测,不会被其他应用程序识别。
Raw images 由照相机、扫描仪等生成,通常比 JPEG 图像给您更多 post 处理灵活性。
如果我从我的网络服务器提供这种文件,我应该使用哪种媒体类型(a.k.a。MIME 类型)? 我特别对最近佳能相机产生的 CR2 文件感兴趣,但答案也可能涉及 Adobe 的数字负片 (DNG) 格式或来自其他制造商相机的原始文件。 (我在 this list from the IANA 中没有看到任何相关内容。)
对于问题的作者来说可能为时已晚,但可能对其他遇到同样问题的人有所帮助。
对于 .CR2
是 image/x-dcraw
。
对于.DNG
是image/x-adobe-dng
根据(已解散?)GNOME RAW Thumbnailer 项目的 this XML file,原始图像的 MIME 类型通常为 image/x-dcraw。按文件扩展名列出,以下是该文件中提到的其他文件类型:
- ARW:image/x-sony-arw
- CR2:image/x-canon-cr2
- CRW:image/x-canon-crw
- DCR:image/x-kodak-dcr
- DNG:image/x-adobe-dng
- ERF:image/x-epson-erf
- K25: image/x-kodak-k25
- KDC:image/x-kodak-kdc
- MRW:image/x-minolta-mrw
- NEF:image/x-nikon-nef
- ORF: image/x-olympus-orf
- PEF:image/x-pentax-pef
- 英国皇家空军:image/x-fuji-raf
- RAW:image/x-panasonic-raw
- SR2:image/x-sony-sr2
- SRF:image/x-sony-srf
- X3F: image/x-sigma-x3f
使用约定Gnome raw thumbnailer might be an option but MIME is assigned by IANA based on reference standards and/or requests of the vendors, so is certainly a non-uffical way even though these are the MIME the vendors are using. The list of official IANA MIME can be found here. All the other list are actually unofficialial. Also, the Wikipedia list经常不更新
如果 MIME 不在列表中,您可以使用 exiftool 等工具提取它并查找 MIME 类型。
我也会考虑使用 application/octet-stream
,这是一种官方 MIME 类型,用于未知类型的二进制数据,如 RFC 2046 中所述,至少应用程序会知道它是一个二进制文件。
如果您不喜欢此解决方案或供应商使用的 MIME,并且需要消除多个 RAW 图像文件的歧义,我会遵循标准中用于其他专有图像类型的约定:image/vnd.<manufacturer>.<filename extension>
例如 Nikon 公司的 NEF 和 Minolta 的 .mrv:
image/vnd.nikon.nef
image/vnd.minolta.mrw
但这当然是纯粹的猜测,不会被其他应用程序识别。