Bug 119170

Summary: Kodak Z700 thumbnail and image retrieval fails, but works in gphoto2
Product: [Applications] digikam Reporter: Austin Clements <amdragon+kdebugzilla>
Component: Import-Gphoto2Assignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 0.8.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Austin Clements 2005-12-29 11:44:48 UTC
Version:           0.8.0 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc 3.3.6 
OS:                Linux

After selecting "USB PTP Class Camera" from the Camera menu, the transfer dialog appears and lists all of the files on my Kodak Z700.  However, none of the thumbnails appear, and the list includes three non-image files: DCEMAIL.ABK, DDISCVRY.DPS, and LABELCTB.LCB.  If I click on any of the image files, an error appears, saying "Failed to retrieve file 100_xxxx.JPG from camera".  If I try to download any of the files, a "Failed to download file 100_xxxx.JPG" error appears.  Both Digikam 0.7.1 and 0.8.0 behave this way.  However, using gphoto2 directly works.

I did some hacking on the code, so I have some idea of what's going wrong, though no idea why.  "gphoto2 -T" successfully transfers the thumbnails, and "gphoto2 -P" gets all images, so I compared the operation of gphoto2 with Digikam.  What I found was that Digikam tries to transfer the thumbnail of DCEMAIL.ABK from "/store_00020001" immediately after retrieving the file list.  As soon as libgphoto2 sends the request for this thumbnail, the protocol locks up and the camera no longer sends any responses to any later requests from libgphoto2, so Digikam can't get any of the real thumbnails or download any photos.  "gphoto2 -T", on the other hand, first tries to download the thumbnail of 100_0001.JPG from "/store_00010001/DCIM/100KZ700".  This succeeds, as do the rest of the images.  Only after downloading all of the image thumbnails does gphoto2 try to download the thumbnail of DCEMAIL.ABK.  This transfer fails as it did for Digikam, which causes gphoto2 to give up at this point.

Going on this, I added an quick hack to Digikam that simply skips downloading anything that doesn't begin with "100" (specifically, I added a check of itemName to GPCamera::getThumbnail).  'Lo and behold, everything works.  All of the thumbnails appear for the image files and I can download images.

Of course, this is the entirely wrong way to go about this.  Could Digikam simply ignore such control files?  Omitting them from the file listing would enhance the interface and not attempting to download thumbnails of them would make Digikam not fail on the Kodak Z700.  I suspect other cameras have similar control files, though I don't know if attempting to download thumbnails of them causes the protocol to freeze as it does for my camera.
Comment 1 Tom Albers 2005-12-29 18:39:41 UTC
Not sure if it is our task to ignore those files, or gphotos task.
Comment 2 Marcus Meissner 2005-12-29 18:42:01 UTC
gphoto should not hang on this file. so its a gphoto problem.

please open a bug with gphoto2 -T --debug output on http://sf.net/projects/gphoto 

Ciao, Marcus (sf user marcusmeissner)
Comment 3 Tom Albers 2005-12-29 18:51:02 UTC
Austin, can you take care of that? If not, please reopen so we can do it, but we dont have the required debug info.
Comment 4 Austin Clements 2005-12-29 22:37:56 UTC
These control files should certainly be included in gphoto's listing of the file system, as they are genuine files that can be downloaded (though gphoto -T chokes on these, gphoto -P successfully downloads them).  I believe Digikam should be responsible for checking the information about these files and omitting them from the listing displayed to the user as well as not attempting to download them.  When I get a chance, I'll poke around the gphoto API and try to figure out how to do this.

I'll open a bug with gphoto, as this affects gphoto -T and libgphoto should not choke when asked to download a control file as a thumbnail.  I'll leave this bug as resolved at least until I get something useful from gphoto.

If I'm not mistaken, these three files are related to the Z700's "easy share" capabilities.  On the camera, there is a way to tag photos, mark them for later emailing, etc.  It would be really cool if digikam could honor these files (the file format looks pretty trivial, though I haven't experimented with it), but I'd be perfectly happy with it ignoring them.
Comment 5 Austin Clements 2005-12-29 23:43:12 UTC
For reference, here is the gphoto bug report:

http://sourceforge.net/tracker/index.php?func=detail&aid=1393207&group_id=8874&atid=108874
Comment 6 willie theunissen 2006-07-09 13:51:04 UTC
I've the same problem with GtKam i can download al my pictures but not with DigiKam. I only see a icoon with a camera on it. I use DigiKam 0.7.3 and 0.8, KDE 3.4.2 en kernel 2.6.12 with Mandriva 2006. Camera Kodak C360, USB PTP class camera
Is there a workaround for this problem.