0

I want to capture RAW images from a Canon Camera (EOS 550D and EOS 1300D) and convert them to RGB without saving them on disk. I was assuming that this should be possible, given the fact that EdsCreateImageRef accepts a StreamRef, which can be either a FileStream or a MemoryStream. However, whenever I use a MemoryStream instead of a FileStream, EdsGetImageRef will return EDS_ERR_FILE_FORMAT_UNRECOGNIZED. I tried several variants:

  • downloading into a MemoryStream and calling EdsGetImageRef directly on this
  • same as above with a seek to the begin of the stream in between
  • downloading into a MemoryStream, extracting data into my own databuffer and filling a new MemoryStream with this data
  • Loading data from disk (from a known-valid CR2 file) manually and filling a MemoryStream with it

The only thing that works is to dump the data to disk, then open this file with EdsCreateFileStream and passing this to EdsGetImageRef. Has anyone ever been able to create a ImageRef for a MemoryStream and if so, can you give pointers as to what needs to be done for this to succeed?

2 Answers2

0

I guess it's the same issue as Canon Digital SDK (EDSDK) EdsCreateImageRef error

I just started using EDSDK v 3.8.0. I had the same issue, but I was able to find out what caused it for me: Version 1.x searches for the dlls in the working path, while 2.x and 3.x search at the location of the exe using the dlls. So copying the files in the debug and release directories of my Visual Studio project fixed it for.

marc40000
  • 3,167
  • 9
  • 41
  • 63
-1

I had same issue.

EDSDK.EdsCreateImageRef returns EDS_ERR_FILE_FORMAT_UNRECOGNIZED

I found a solution.

In my project EDSDK.dll placed in filder EDSDK\Dll. And DllImport looks like [DllImport("EDSDK\Dll\EDSDK.dll")]

It works with JPEG files, but not with CR2.

Then I place all dll from EDSDK\Dll to root project folder and change DllImport.

It works for me.

And after than I have found extremely useful text in EDSDK manual

1.4.3 Executing the EDSDK Client Application Windows: All DLLs are required in order to execute an EDSDK client application. All of the modules in the DLL folder must be copied into the same folder where the EDSDK client application is in.

Need it helps