Bug 257806

Summary: Images imported from backup card + filtering icon-view [patch]
Product: [Applications] digikam Reporter: Petri Damstén <petri.damsten>
Component: Import-UMSAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, mailinglist
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.1.0
Attachments: Import Filters
Import Filters with Conguration dialog
Import Filters for 2.0
Back trace for crash when opening import dialog
Import Filters for 2.0
Import Filters for 2.0
Always ignore

Description Petri Damstén 2010-11-24 18:36:36 UTC
Version:           1.7.0 (using KDE 4.5.3) 
OS:                Linux

Nikon D7000 has two card slots. Another card can be selected to be a backup of the first card. When photos are imported they are imported from both cards producing a duplicate of every photo.

Reproducible: Always



Expected Results:  
- Only import photos from main card. Probably user selectable since second card can be also used as an extra space (or RAW to card 1 and JPG to card 2)
- Automatically remove duplicates from list. Photos deleted in camera seem to stay on backup card so simply checking for duplicate would show deleted photos though.
Comment 1 Petri Damstén 2010-12-17 11:52:00 UTC
Created attachment 54857 [details]
Import Filters

This patch adds a Filter combobox to status bar which can be used to show only sub set of files in camera/usb drive. Patch also fixes small bug in umscamera.cpp where date was not get from file system info. 

Configure dialog for filters not yet implemented.
Comment 2 Petri Damstén 2010-12-28 13:56:35 UTC
Created attachment 55313 [details]
Import Filters with Conguration dialog
Comment 3 Andi Clemens 2011-03-06 11:52:50 UTC
Hi Petri,

thanks for the patch. It seems that you have created the patch for the 1.x.x series of digiKam (SVN).

digiKam has moved to git and the current development version is 2.0.0. Could you please verify that the patch is still working with the new development branch and if not, apply the needed changes, so that we can review the patch?

Andi
Comment 4 caulier.gilles 2011-03-06 11:57:53 UTC
Git super repository to checkout digiKam & co is there :

https://projects.kde.org/projects/extragear/graphics/digikam/digikam-software-compilation

Gilles Caulier
Comment 5 Petri Damstén 2011-03-14 13:32:38 UTC
Created attachment 57966 [details]
Import Filters for 2.0

Import filters updated to 2.0. Could not test it yet since getting a crash.
Comment 6 Petri Damstén 2011-03-14 13:35:09 UTC
Created attachment 57967 [details]
Back trace for crash when opening import dialog

Happens also when import filter patch is not applied.
Comment 7 caulier.gilles 2011-03-14 13:40:17 UTC
It's definitivly a crash from libgphoto2 :

[KCrash Handler]
#6  __libc_realloc (oldmem=0x3801, bytes=9888) at malloc.c:3769
#7  0x00007fd5eaac6553 in register_platform () from /usr/lib/libdc1394.so.22
#8  0x00007fd5b8cede88 in gp_port_library_list () from /usr/lib/libgphoto2_port/0.8.0/usb.so
#9  0x00007fd5fbcda388 in ?? () from /usr/lib/libgphoto2_port.so.0
#10 0x00007fd5f1e3b08e in ?? () from /usr/lib/libltdl.so.7
#11 0x00007fd5f1e3ac66 in ?? () from /usr/lib/libltdl.so.7
#12 0x00007fd5f1e3ad11 in lt_dlforeachfile () from /usr/lib/libltdl.so.7
#13 0x00007fd5fbcda28d in gp_port_info_list_load () from /usr/lib/libgphoto2_port.so.0
#14 0x00000000006f86bc in Digikam::GPCamera::findConnectedUsbCamera (vendorId=1200, productId=1064, model=<value optimized out>, port=<value optimized out>) at /home/damu/Development/src/digikam-software-compilation/core/utilities/cameragui/devices/gpcamera.cpp:1761
#15 0x0000000000574e70 in Digikam::DigikamApp::openSolidCamera (this=0x288e3f0, udi=..., cameraLabel=...) at /home/damu/Development/src/digikam-software-compilation/core/digikam/main/digikamapp.cpp:1828
#16 0x00000000005751b1 in Digikam::DigikamApp::slotOpenSolidCamera (this=0x288e3f0, action=0x4542eb0) at /home/damu/Development/src/digikam-software-compilation/core/digikam/main/digikamapp.cpp:1774

To test your patch, without your camera, create a test album with some image and add it a a test camera. set the camera mount path to your album path.

Gilles Caulier
Comment 8 caulier.gilles 2011-03-14 13:41:09 UTC
Forget to said : use UMS (USB Mass Storage) camera type to create test camera.

Gilles Caulier
Comment 9 Petri Damstén 2011-03-14 15:41:53 UTC
Tested the new patch (with the usb stick) and it seems to work as in 1.9.0.
Comment 10 Petri Damstén 2011-08-12 09:28:16 UTC
Created attachment 62769 [details]
Import Filters for 2.0

Compile with newest git. Any news if this patch gets rejected or accepted?
Comment 11 caulier.gilles 2011-08-12 09:39:01 UTC
Sorry for the delay.

You patch is huge. I need to test indeep before to accept.

Gilles Caulier
Comment 12 caulier.gilles 2011-08-12 10:32:07 UTC
Petri,

You have add a dialog to setup filter mime-type.

With current code from git master, i introduced a new settings tab named "behavior" in Camera Setup dialog. Please add your filter settings as a new tab of this, not as a separated dialog.

Look my screenshot for details :

http://www.flickr.com/photos/digikam/6028399563/sizes/o/in/photostream/

Gilles Caulier
Comment 13 caulier.gilles 2011-08-12 10:35:35 UTC
*** Bug 196433 has been marked as a duplicate of this bug. ***
Comment 14 caulier.gilles 2011-08-12 12:14:25 UTC
Petri,

I just updated a lots source code in camera gui. I prepared code for future port of icon-view to qt4 model/view.

Please update your patch to compile fine with current implementation from git master.

Thanks in advance

Gilles Caulier
Comment 15 caulier.gilles 2011-08-12 13:36:35 UTC
Petri,

Look report https://bugs.kde.org/show_bug.cgi?id=204006

This is not the same problem ?

Gilles Caulier
Comment 16 Petri Damstén 2011-08-12 13:47:51 UTC
No, my problem is that when using two cards and mirroring feature there are always duplicate images in camera. I don't have time to get back to this until late August, but I'm working on this.
Comment 17 Petri Damstén 2011-08-23 15:01:46 UTC
Created attachment 63075 [details]
Import Filters for 2.0

- Configuration moved to setup dialog
- Added mime type filter
Comment 18 caulier.gilles 2011-08-24 12:00:26 UTC
Thanks Petri,

Patch downloaded. I will review it soon...

Gilles Caulier
Comment 19 caulier.gilles 2011-08-24 13:14:05 UTC
Git commit fbf8bcebe28cafe83db51d73d4b6cfd8ae64921c by Gilles Caulier.
Committed on 24/08/2011 at 15:12.
Pushed by cgilles into branch 'master'.

apply path #63075 from Petri Damsten To add new filter option for camera icon view
CCBUGS: 257806

M  +1    -0    utilities/cameragui/CMakeLists.txt
M  +5    -0    utilities/cameragui/main/cameraui_p.h
A  +79   -0    utilities/setup/importfilters.h     [License: GPL (v2+)]
A  +102  -0    utilities/cameragui/widgets/filtercombo.h     [License: GPL (v2+)]
M  +23   -13   utilities/cameragui/main/cameraui.cpp
M  +1    -0    utilities/cameragui/main/cameraui.h
M  +1    -0    CMakeLists.txt
M  +5    -0    utilities/setup/setupcamera.h
A  +295  -0    utilities/cameragui/widgets/filtercombo.cpp     [License: GPL (v2+)]
A  +225  -0    utilities/setup/importfilters.cpp     [License: GPL (v2+)]
M  +141  -0    utilities/setup/setupcamera.cpp

http://commits.kde.org/digikam/fbf8bcebe28cafe83db51d73d4b6cfd8ae64921c
Comment 20 caulier.gilles 2011-08-24 13:23:33 UTC
Petri,

I commit your patch reviewed (with some coding style adjustments)

Some remark to improve it and to close definitively this entry :

- In importfilter.cpp, ElidedLabel can be remplaced by KSqueezedTextLabel from KDE API.

- In importfilter.h, please use a d private internal container to speed-up compilation and reduce header files to includes.

- There is a suggestion about to add a filter for unwanted files in camera icon-view. This feature is already implemented and hardcoded in CameraUI::slotRefreshIconViewTimer(), to handle "mgr_data", "pgr_mgr", "dsp", and "dps" as always unlisted files from camera. I think this must be configurable somewhere in setup to be able to add new type to ignore from camera. What do you think about ?

Best

Gilles Caulier
Comment 21 Petri Damstén 2011-08-24 14:30:25 UTC
Can those fixes be committed directly to master?

I could add 'Always Ignore' field to 'Import Filters'-page?
Comment 22 caulier.gilles 2011-08-24 15:31:02 UTC
Petri,

You have a git account as developer ? If yes, sure, let's go...

And yes, 'Always Ignore' field must be add to 'Import Filters' page.

Thanks for your help

Gilles Caulier
Comment 23 Petri Damstén 2011-08-24 15:34:04 UTC
Git commit e58c3ab15b4b6495f993075e021d6fb557d0637a by Petri Damstén.
Committed on 24/08/2011 at 15:53.
Pushed by pdamsten into branch 'master'.

Use KSqueezedTextLabel widget.

CCBUGS: 257806

M  +2    -3    utilities/setup/importfilters.h
M  +2    -30   utilities/setup/importfilters.cpp

http://commits.kde.org/digikam/e58c3ab15b4b6495f993075e021d6fb557d0637a
Comment 24 Petri Damstén 2011-08-25 07:31:23 UTC
Created attachment 63132 [details]
Always ignore

Always ignore box to import filter page. Ok to commit?
Comment 25 caulier.gilles 2011-08-25 08:22:01 UTC
Petri,

yes sure, and let's go to close this file with BUGS macro (:=)))

Gilles Caulier
Comment 26 Petri Damstén 2011-08-25 08:26:25 UTC
Different email in git so BUGS macro did not close it. Closing it here.