如何在C#中确定文件是Camera Raw还是Tif? [英] How To Determine if a file is a Camera Raw or a Tif in c#?

查看:121
本文介绍了如何在C#中确定文件是Camera Raw还是Tif?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个需要确定图像文件是tiff还是相机原始文件的应用程序.我已经有代码确定图像文件似乎是有效图像.

我遇到的问题是确定文件是否为Raw文件,例如CR2或tiff文件".Tif".我遇到此问题的主要原因是底层文件结构实际上看起来几乎相同-即99%的相机原始文件在引擎盖下使用tif文件结构.我不能只阅读标题并看到确切的区别.我也不能使用文件扩展名,因为Cannon是白痴,并决定为EOS 1D提供原始文件扩展名".tif".

有谁能够确定这两种文件类型之间的区别?如果不能,那么任何人都可以根据我可以尝试读取的文件本身中的标记向正确的方向指点我.以下是我需要使用的Raw文件列表:

".cr2",
".crw",
".dcr",
".dng",
".mef",
".mos",
".nef",
".sti",
".tif",
".tiff",
"iiq"

一定有办法.任何帮助,将不胜感激

谢谢

Kev

Hi All,

I am working on an application that needs to determine whether an image file is a tiff or a camera raw file. I already have code working to determine that an image file appears to be a valid image.

The problem I am having is determining whether a file is a Raw file, e.g. a CR2 or a tiff file, ".Tif". The main reason I am having this problem is that the underlying file structures actually appear pretty much the same - i.e. 99% of camera raw files use the tif file structure underneath the hood. I cannot just read the header and see a definitive difference. I also cannot use the extension of the file because Cannon are idiots and decided for the EOS 1D they would give their raw files a ".tif" file extension.

Has anyone been able to determine the difference between these two file types? If not can anyone point me in the right direction in terms of markers within the file itself that I can try to read. Below is the list of Raw files I need to work with:

".cr2",
".crw",
".dcr",
".dng",
".mef",
".mos",
".nef",
".sti",
".tif",
".tiff",
"iiq"

There must be a way. Any help with this would be greatly appreciated

Thanks

Kev

推荐答案

您是否检查了文件的特殊属性,例如作者和来源?
Did u checkd the file special attributes like author and source?


这篇关于如何在C#中确定文件是Camera Raw还是Tif?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆