diff --git a/camlibs/ptp2/ChangeLog b/camlibs/ptp2/ChangeLog index bbca87595..e59f925ec 100644 --- a/camlibs/ptp2/ChangeLog +++ b/camlibs/ptp2/ChangeLog @@ -1,3 +1,8 @@ +2006-08-31 Marcus Meissner + + * library.c: Handle cameras which just have files, but no + directory or root object. Kodak EasyShare C330 for instance. + 2006-08-30 Marcus Meissner * library.c: Added iRiver Clix. diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index b35575133..c46bbf5ef 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3241,9 +3241,27 @@ fallback: GP_DEBUG("Changing DCIM ParentObject ID from 0x%x to 0", oi->ParentObject); oi->ParentObject = 0; + nroot++; } } } + /* Some cameras do not have a directory at all, just files or unattached + * directories. In this case associate all unattached to the 0 object. + */ + if (nroot == 0) { + /* look for entries with parentobjects that do not exist */ + for (i = 0; i < params->handles.n; i++) + { + int j; + PTPObjectInfo *oi = ¶ms->objectinfo[i]; + + for (j = 0;j < params->handles.n; j++) + if (oi->ParentObject == params->handles.Handler[j]) + break; + if (j == params->handles.n) + oi->ParentObject = 0; + } + } } #if 0 add_dir (camera, 0x00000000, 0xff000000, "DIR1");