Bug 341053 - Text Filter broken [patch]
Summary: Text Filter broken [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-Filters (show other bugs)
Version: 4.5.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-17 15:39 UTC by DrSlony
Modified: 2014-12-03 08:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.6.0


Attachments
Imagefiltersettings.patch (1.13 KB, patch)
2014-12-02 18:29 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DrSlony 2014-11-17 15:39:40 UTC
The "Text Filter" is broken.

I have a folder full of PEF and DNG images. File names are:
2014-10-26_helsingborg_01.pef to 52, and some are in the DNG format.
Merged bracketed shots have this filename:
2014-10-26_helsingborg_21-25.dng (note the 21-25 part).
Also to test, I renamed the last photo to 2014-10-26_helsingborg_52 woof.pef
If I type "woof" in the text filter, I see:
2014-10-26_helsingborg_06-10.dng
2014-10-26_helsingborg_12-15.dng
2014-10-26_helsingborg_16-20.dng
2014-10-26_helsingborg_21-25.dng
2014-10-26_helsingborg_26-30.dng
2014-10-26_helsingborg_31-35.dng
2014-10-26_helsingborg_34.pef
2014-10-26_helsingborg_35.pef
2014-10-26_helsingborg_36-40.dng
2014-10-26_helsingborg_42-44.dng

If I type "gonzo", I see those same images. "gonzo" is a random word which I'm 100% sure does not exist in any of the files in any form, metadata or otherwise.
If I type "pef", ".pef" or "*.pef" to see only PEF files, I see... all of them!

Reproducible: Always
Comment 1 DrSlony 2014-12-01 15:43:41 UTC
I hope this gets attention before 4.6, as it's quite a basic core functionality that's broken.
Comment 2 Maik Qualmann 2014-12-02 18:29:01 UTC
Created attachment 89810 [details]
Imagefiltersettings.patch

I also have pictures with "gonzo" ;-) This images have a wrong pixel size (==0) in the database.

Changes:

imagefiltersettings.h:

enum TextFilterFields
{
 None             = 0x00,
 ImageName        = 0x01,
 ImageTitle       = 0x02,
 ImageComment     = 0x04,
 TagName          = 0x08,
 AlbumName        = 0x10,
 ImageAspectRatio = 0x12, // AlbumName | ImageTitel ??? to -> 0x20
 ImagePixelSize   = 0x14, // AlbumName | ImageComment ??? to -> 0x40
 ...
 }

 imagefiltersettings.cpp:
 
 Only digits are accepted for ImagePixelSize, text would always be zero.
Comment 3 caulier.gilles 2014-12-02 22:12:08 UTC
Maik,

Thanks a lots to review code and to build patch.

This ugly code are probably injected by students this summer, and i don't detect it myself or with static code analyzer (Coverity).

I will review you patch before 4.6.0 release.

Best

Gilles Caulier
Comment 4 caulier.gilles 2014-12-03 08:55:20 UTC
Git commit d92e25b6a1b9ee328d0312810241a3ecf2a21b2c by Gilles Caulier.
Committed on 03/12/2014 at 08:53.
Pushed by cgilles into branch 'master'.

apply patch #89810 from Maik Qualmann to fix text filtering enum values and rules from FilterSettings about image pixel sizes filtering
FIXED-IN: 4.6.0

M  +2    -1    NEWS
M  +10   -7    libs/models/imagefiltersettings.cpp
M  +8    -8    libs/models/imagefiltersettings.h

http://commits.kde.org/digikam/d92e25b6a1b9ee328d0312810241a3ecf2a21b2c