0

I am trying to use the Canon Eos Digital SDK (EDSDK) to decode a CR2 camera image for display in a desktop GUI.

I run the first few methods as follows:

err = EDSDK.EdsInitializeSDK();
err = EDSDK.EdsCreateFileStream(
                fullpath, 
                EDSDK.EdsFileCreateDisposition.OpenExisting, 
                EDSDK.EdsAccess.Read, 
                out inStream);
err = EDSDK.EdsCreateImageRef(inStream, out imgRefPtr);

And the err variable remains as EDS_ERR_OK until it executes the last line above, where it becomes EDS_ERR_FILE_FORMAT_UNRECOGNIZED.

The camera that took the image was a EOS 5DS R, which has been supported from the 3.2.1 release (our current version). Moreover, the CR2 image can be opened in the raw image viewer, Digital Photo Professional 4.

Any suggestions on how to overcome the file format unrecognized error when trying to create image reference?

  • 1
    the image tools of the 3.x versions seem to be rather broken still. I've had problems with saving photos whereas the same code works perfectly with 2.x versions. – Johannes Bildstein Feb 22 '16 at 21:09

2 Answers2

1

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
0

I'm trying to solve a similar issue right now with the same camera and Canon SDK. The changelog for this release states:

"Added support for RAW development functionality. Added support for RAW development functionality for the beta version of 64-bit module. Please note:Supported cameras are limited as below for the image hadling functions in 64-Bit module. EOS 5DS / EOS 5DS R / EOS REBEL T6s / EOS 760D / EOS 8000D / EOS REBEL T6i / EOS 750D / EOS Kiss X8i / EOS M3"

Have you tried to perform the image processing via a 64-bit application?

  • I have tried on both 32-bit and 64-bit test applications. Interestingly, I get the same error when trying to decode the using the EOS 5D Mark III, where the support was added in 2.11. Additionally, I'm attempting to use the libraw image decoding library with more - but not complete - success. – David Button Feb 23 '16 at 01:57
  • In 32-bit I also tried a Canon 5D Mark II camera and had the same problem. It seems Canon broke EdsCreateImageRef for both loading .cr2 files and for developing a streamed image. David, please let me know if you have better luck with libraw! – pocruadhlaoich Feb 24 '16 at 13:03
  • I was able to successfully decode the images by using Libraw. Being a C# developer, I had to first P/Invoke and Marshall the required functions and structures, then followed the methodology similar to that in the samples/cdraw_emulator file. Best of luck to you – David Button Mar 10 '16 at 07:58