简体   繁体   English

使用edsdk加载cr2时出错

[英]Error loading cr2 with edsdk

I am trying to read cr2 images using canon sdk (canon_edsdk-2.12). 我正在尝试使用佳能SDK(canon_edsdk-2.12)读取cr2图像。

I seem to be loading the dll correctly, but when I try to get the actual image, I get an error. 我似乎正确加载了dll,但是当我尝试获取实际图像时,出现错误。

I tried to run the sample program to see how that is different than mine, but the same thing happens. 我试图运行示例程序,以查看与我的示例有何不同,但同样的事情也会发生。

Trying to look for the issue on the web, I found the actual source code of the sample: http://read.pudn.com/downloads107/sourcecode/graph/texture_mapping/440409/RAWDevelop/RAWDevelopDlg.cpp__.htm 为了在网上寻找问题,我找到了示例的实际源代码: http : //read.pudn.com/downloads107/sourcecode/graph/texture_mapping/440409/RAWDevelop/RAWDevelopDlg.cpp__.htm

My error, on the given source, is in the void CRAWDevelopDlg::LoadImage() function - 在给定的源上,我的错误是在void CRAWDevelopDlg::LoadImage()函数中-

err = EdsGetImage( m_ImageRef , source , kEdsTargetImageType_RGB , rect , size , DstStreamRef );   
if( err == EDS_ERR_OK ) {...}
else   
{   
   AfxMessageBox("The error occurred with the EdsGetImage function.");   
} 

The above (on line 481 on the page) is the same method that I use, and i get the same error - with error code 35 (instead of 0). 上面的内容(在页面的第481行上)与我使用的方法相同,并且出现相同的错误-错误代码为35(而不是0)。

The error seems to be 错误似乎是

#define EDS_ERR_FILE_OPEN_ERROR                          0x00000023L

So... could there be something wrong with the files ? 那么...文件可能出问题了吗? I experimented with files taken by different versions, including the newest cameras... The files open in Photoshop... And the demo does show header information, as it gives the error. 我尝试了使用不同版本拍摄的文件,包括最新的相机...这些文件在Photoshop中打开...并且该演示确实显示了标头信息,因为它给出了错误。 So it can see something. 这样它可以看到一些东西。

Am I missing anything ? 我有什么想念的吗?

All the required dll's used are on the system path... 使用的所有必需的dll在系统路径上...

Thank you. 谢谢。

Old question, still, might help someone: 仍然存在一个老问题可能会帮助某人:

To open a raw file with the SDK you need to call these functions (you should check for errors, of course): 要使用SDK打开原始文件,您需要调用以下函数(当然,您应该检查错误):

EdsStreamRef stream = NULL;
EdsImageRef imgRef = NULL;
EdsCreateFileStream("filename", kEdsFile_OpenExisting, kEdsAccess_Read, &stream);
EdsCreateImageRef(stream, &imgRef);
EdsRelease(stream);

Then you can set and get properties with the imgRef. 然后,您可以使用imgRef设置和获取属性。

To save the image as jpg/tiff/RGB image use EdsSaveImage function. 要将图像另存为jpg / tiff / RGB图像,请使用EdsSaveImage函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM