GNOME Bugzilla – Bug 324752
Photo import doesn't work for Canon Ixus 50 (PTP)
Last modified: 2006-03-08 17:00:21 UTC
Please describe the problem: Photo import from a Canon Ixus 50 (PTP mode) camera doesn't work. gthumb and gphoto2 which also use libgphoto2 to access camera via usb work. Steps to reproduce: 1. File -> Import from camera 2. Select the camera in the device list (detection is ok) Actual results: Popup with error non specified. Fail properly, we go back to the main window Expected results: That the window with previews of the photo of my cameras appears. Does this happen every time? Yes Other information: I'm going to post some other messages with all the informations i found on this problem. Please give me ten minutes to do it.
I trace the problem. Problem is : ListFiles calls gp_filesystem_list_files() (a libgphoto2 function) which fails with error -1 (non specified). I trace it into libgphoto2 (last version 2.1.6). It's caused by the existence in the Canon products of a /special folder, so first : - this folder is not scanned like others. But the special scan is applied only if folder = '/special' and f-spot give '/special/' - even if this is corrected, '/special/' doesn't have preview, so the scan fails If I ignore error in the ListFiles and correct /special/ to /special, I can view the preview, import works fine at the beginning then fails (surely on /special/ files) I see source code of gthumb or gphoto. They doesn't use gp_filesystem_list_files but gp_camera_folders_list_files and this two applications work fine. This function surely is higher level and filters 'system' folders (supposition, I don't read the code) So i suspect a wrong use of the libgphoto2 API.
If I ignore errors in Gphoto binding (an extract may be useful maybe : public CameraList ListFiles (string folder, Context context) { ErrorCode result; CameraList list = new CameraList(); unsafe { result = gp_filesystem_list_files (this.Handle, folder, list.Handle, context.Handle); Console.Write(folder + ": " + result + "\n"); } // if (Error.IsError(result)) throw Error.ErrorException(result); return list; } => throw eroor commnted out and i don't correct error for the /special/ folder (ie I let /special/ as folder, so specific scan is not applied by libgphoto2) then all work fine (I can import photos). Proposed explication : - scan on /special fails silently so preview or files are not downloaded during the import process This is not a solution I think, but a confirmation of what i say previously
I should investigate more. Maybe you can give a shot a libgphoto2 2.1.99
the /special folder was a try of mine to add theme support. i disabled it in later versions again. so using 2.1.99 will work (and hide the /special folder).
*** Bug 172097 has been marked as a duplicate of this bug. ***
Is this one fixed with 2.1.99? Can it still be reproduced, or can we close this one?
I seem to have this problem with my camera - Canon Powershot S2IS. Upgrading to 2.1.99 works correctly, except it doesn't correctly display the list import dialog. I have narrowed the problem to src/ImportCommand.cs:306 (from 0.1.10 release): if (source_count == 1 || cam.CameraList.GetValue (i) != "usb:") { The if causes it to not display the camera.. is there a reason for the != "usb:" or is this a bug in libgphoto? Changing the != to an == makes it list correctly and imports fine.
can you install the gphoto2 commandline tool and try: gphoto2 --auto-detect and check the output? if it contains ports other than "usb:" this might be the culprit.
libgphoto 2.1.99 $ gphoto2 --auto-detect Model Port ---------------------------------------------------------- Canon PowerShot S2 IS (PTP mode) usb: 2.1.6 $ gphoto2 --auto-detect Model Port ---------------------------------------------------------- Canon PowerShot S2 IS (PTP mode) usb: Canon PowerShot S2 IS (PTP mode) usb:001,033 It seems that this is certainly the culprit. Unfortunatley the 2.1.6 version doesn't work as established with this bug. What should I do next? :-)
2.1.6 had the bug where the camera would be listed multiple times like seen above, I think the quoted check works around this. Hmm. The if check is ok, it would also work for the single autodetected camera case. (the source_count == 1 case triggers and should add the camera). Strange :/
The check is meant to handle exactly this case, more than on entry would be listed for a single camera and only one of them would function properly. And like Marcus mentions the check is specifically designed to handle a single "usb:" camera. I don't see how your problem could occur given the 2.1.99 output you showed. can you add a System.Console.WriteLine ("source_count = {0}", source_count); right before the line that does the check.
Immediately before the if it has printed: source_count = 2 I did some more checking and noticed that it was picking up a NFS mounted directory that caused the source_count to begin at 1, when it added in the camera count it gets the result above. I changed the if to use cam.CameraList.Count () directly, and it appears to work correctly in my case. The other alternative is to add the cameras before adding the GnomeVFS volumes. I recommend doing either simple change and for the next release my camera should be happy. :-) Did you want a patch or is this trivial enough to not bother?
ok I've committed the fix that uses the camera count properly. it will be fixed in 0.1.11