c++edsdkcanon-sdk

Browsing images on SD card via Canon EOS SDK (c++)


I can succesfully download to disk the picture that has been just shot using kEdsSaveTo_Host and catching the event.

However, for various reasons i need to not download it to the pc immediately but to shoot, then browse what is available on the camera, get the latest image, and delete it.

Is this possible with the canon SDK ? I can't really go past using kEdsSaveTo_Camera. How do i browse the SD? how do i download an image? Is it something i can do with the canon sdk or should i simply release the cameras, and then use windows API to browse the content, download and delete the image?

thank you in advance!


Solution

  • You can go through the file system with calling EdsGetChildCount, EdsGetChildAtIndex and EdsGetVolumeInfo or EdsGetDirectoryItemInfo.

    Basically, call EdsGetChildCount with the camera pointer as parameter to get the number of volumes. Go through every volume with EdsGetChildAtIndex (again with the camera pointer as parameter) and call EdsGetVolumeInfo with the volume pointer from the EdsGetChildAtIndex call to get information about the volume.

    With each volume you can do the same as before the get files and folders but instead of the camera pointer you pass the volume pointer to it. To get information about the file or folder use EdsGetDirectoryItemInfo. The struct that this function returns states if it's a folder or file.

    If it's a folder you can repeat the above again but of course use the folders pointer instead of the volumes.

    To download a file you can do the same as you do with SaveTo_Host and use the files pointer.

    If you don't mind reading C# I have implemented all of that in this project: http://www.codeproject.com/Articles/688276/Canon-EDSDK-Tutorial-in-Csharp

    You can find the most relevant part at the bottom of the Camera.cs file.