After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324752 - Photo import doesn't work for Canon Ixus 50 (PTP)
Photo import doesn't work for Canon Ixus 50 (PTP)
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
0.1.x
Other All
: Normal normal
: ---
Assigned To: F-spot maintainers
F-spot maintainers
: 172097 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-12-21 22:53 UTC by Laurent Almeras
Modified: 2006-03-08 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Almeras 2005-12-21 22:53:49 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.
Comment 1 Laurent Almeras 2005-12-21 23:11:36 UTC
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.
Comment 2 Laurent Almeras 2005-12-21 23:26:56 UTC
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
Comment 3 Hubert Figuiere (:hub) 2006-01-09 16:15:44 UTC
I should investigate more.

Maybe you can give a shot a libgphoto2 2.1.99
Comment 4 Marcus Meissner 2006-01-09 16:33:31 UTC
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).
Comment 5 Larry Ewing 2006-01-10 02:02:04 UTC
*** Bug 172097 has been marked as a duplicate of this bug. ***
Comment 6 Bengt Thuree 2006-02-20 05:25:46 UTC
Is this one fixed with 2.1.99? Can it still be reproduced, or can we close this one?
Comment 7 Trevor Nichols 2006-03-02 01:09:43 UTC
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.
Comment 8 Marcus Meissner 2006-03-02 10:56:00 UTC
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.
Comment 9 Trevor Nichols 2006-03-03 07:37:33 UTC
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? :-)
Comment 10 Marcus Meissner 2006-03-03 08:03:19 UTC
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 :/
Comment 11 Larry Ewing 2006-03-03 18:28:56 UTC
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.
Comment 12 Trevor Nichols 2006-03-04 02:09:29 UTC
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?
Comment 13 Larry Ewing 2006-03-08 17:00:21 UTC
ok I've committed the fix that uses the camera count properly.  it will be fixed in 0.1.11