Bug 180268

Summary: Search by specific metadata as Artist, Byline, Location, City, Country, etc... [patch]
Product: [Applications] digikam Reporter: Ingomar Wesp <ingomar>
Component: Searches-AdvancedAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: caulier.gilles, chentaocredungtao, damien.courousse, jens-bugs.kde.org, johannes.lists+bugs.kde.org, jose_oliver, marcel.wiesweg, mcfarol84, metzpinguin, michal, mikmach, patrick, veaceslav.munteanu90
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: The Advanced Search dialog of digikam 0.10.0-beta7
Search by creator

Description Ingomar Wesp 2009-01-10 16:47:13 UTC
Version:            (using Devel)
Installed from:    Compiled sources

As some people tend to import other people's photos into their own collections, it would be nice if Digikam's search interface would allow searching for the string stored in the Exif.Image.Artist / IPTC.Application2.Byline fields.
Comment 1 caulier.gilles 2009-01-10 17:02:15 UTC
Are you tested KDE4 version ?

Gilles Caulier
Comment 2 Ingomar Wesp 2009-01-11 19:32:23 UTC
(In reply to comment #1)
> Are you tested KDE4 version ?

Yes, I've been running 0.10.0-beta7, but I can't seem to find a corresponding field in the "Advanced Search" dialog. Maybe I'm missing something?
Comment 3 Mikolaj Machowski 2009-01-11 20:51:35 UTC
Yes, in last section of dialog. May be hidden - scroll page down.
Comment 4 Ingomar Wesp 2009-01-11 21:28:46 UTC
Created attachment 30142 [details]
The Advanced Search dialog of digikam 0.10.0-beta7
Comment 5 Ingomar Wesp 2009-01-11 21:29:13 UTC
(In reply to comment #3)
> Yes, in last section of dialog. May be hidden - scroll page down.

I hate to be such an annoyance, but I still can't find a field corresponding to the photographer. Should it be in "Photograph Information"? I'm attaching a screenshot of the "Advanced Search" dialog as it looks on my system (manipulated only to fit the scrolling viewport into a single image).
Comment 6 Mikolaj Machowski 2009-01-11 23:49:22 UTC
Sorry. You are right.

This would be really useful feature. I wonder if it would be possible to automatically populate list of photographers.
Comment 7 Marcel Wiesweg 2009-01-12 21:17:11 UTC
It's just a matter of adding the UI, we can and will more options to the Advanced search in future versions.
Comment 8 Ingomar Wesp 2009-01-12 21:58:00 UTC
(In reply to comment #7)
> It's just a matter of adding the UI, we can and will more options to the
> Advanced search in future versions.

Awesome! I'm really looking forward to that.
Comment 9 caulier.gilles 2011-07-02 10:13:09 UTC
Marcel,
It have been implemented for 2.0.0 ?

Gilles Caulier
Comment 10 Marcel Wiesweg 2011-07-11 14:40:37 UTC
No, I have two or three of these on my list, not done yet
Comment 11 caulier.gilles 2011-12-15 12:51:40 UTC
*** Bug 193238 has been marked as a duplicate of this bug. ***
Comment 12 caulier.gilles 2012-02-10 09:32:49 UTC
Munteanu,

To support more text field from IPTC advanced search engine, Look below :

1/ From Advanced Search Windows, already IPTC text field are implemented here in searchfields.cpp. Look like "headline" field is implemented in GUI:

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/searchwindow/searchfields.cpp#L525

To be able to manage it by search group, just declare it in searchgroup.cpp like this:

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/searchwindow/searchgroup.cpp#L141

2/ GUI will send query to DB using XML in background, using KIOSlave. All is already managed by existing implmentation, but in DB manager code, you need to implement the SQL query relevant. For "headline", look like code is simple :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/database/imagequerybuilder.cpp#L1142

You need to query DB on right table and right property to find relevant item, accordingly with IPTC field to search.

Not all IPTC field are registered in DB. You will find DB schema in this LibreOffice file in digikam/project/documents folder from git/master.

Currently only 4 IPTC field are managed in advanced search window : 

- Caption,
- Author,
- Headline,
- Title.

Database support more as :

- Source,
- Copyright
- Credit,
- Special Instructions,
- Contact Info,
- etc...

You need to check where data are stored in DB, check which are missing exactly and which can be add easily and quickly implemented by your students.

If you need more information about DB schema, ask to Marcel in this room.

Gilles Caulier
Comment 13 caulier.gilles 2012-02-10 09:34:57 UTC
Munteanu,

Look in screenshot attached to this file, current IPTC field are implemented in advance search window into "Caption, Comments, Title" section...

Gilles Caulier
Comment 14 caulier.gilles 2015-05-15 22:27:25 UTC
Maik,

Look my comments #12 and #13 which describe technically all details to implement this wish.

Gilles Caulier
Comment 15 Johannes 2018-09-14 12:05:54 UTC
Created attachment 114952 [details]
Search by creator

(In reply to Ingomar Wesp from comment #0)
> As some people tend to import other people's photos into their own
> collections, it would be nice if Digikam's search interface would allow
> searching for the string stored in the Exif.Image.Artist /
> IPTC.Application2.Byline fields.

I would like to search for Xmp.dc.creator within digikam. I'm just an ordinary user with basic programming skills so I'm not sure if the provided patch is working.

These should be the current URLs to the files Gilles Caulier pointed out in comment #12:
https://cgit.kde.org/digikam.git/tree/utilities/searchwindow/searchfields.cpp?h=development/6.0.0#n617

https://cgit.kde.org/digikam.git/tree/utilities/searchwindow/searchgroup.cpp?h=development/6.0.0#n167

https://cgit.kde.org/digikam.git/tree/libs/database/item/imagequerybuilder.cpp?h=development%2F6.0.0#n1432

Database Schema: https://cgit.kde.org/digikam.git/tree/project/documents/DBSCHEMA.ODS
Comment 16 Maik Qualmann 2018-09-14 17:48:12 UTC
The SQL query is not correct, a table column "creator" does not exist. Only "proberty" with an entry as "creator". I'll watch it on the weekend.

Maik
Comment 17 Johannes 2018-09-14 17:59:59 UTC
(In reply to Maik Qualmann from comment #16)
> The SQL query is not correct, a table column "creator" does not exist. Only
> "proberty" with an entry as "creator". I'll watch it on the weekend.

I'm sorry, was uploading it to fast.
It should be the following, I think:

+    else if (name == QLatin1String("creator"))
+    {
+        sql += QString::fromUtf8(" (Images.id IN "
+               " (SELECT imageid FROM ImageCopyright "
+               "  WHERE property='creator' AND value ");
+        ImageQueryBuilder::addSqlRelation(sql, relation);
+        sql += QString::fromUtf8(" ?)) ");
+        *boundValues << DatabaseComment::Comment << fieldQuery.prepareForLike(reader.value());
+    }
Comment 18 Maik Qualmann 2018-09-14 18:12:26 UTC
Yes, I had it ready ((:-)) Of boundValues still DatabaseComment::Comment must be removed.

Maik
Comment 19 Maik Qualmann 2018-09-14 21:15:24 UTC
Git commit 2d199f612c4c428cedee0d4c3a8c647aba790f17 by Maik Qualmann.
Committed on 14/09/2018 at 21:11.
Pushed by mqualmann into branch 'master'.

apply patch #114952 from Johannes to add search by creator

M  +9    -0    core/libs/database/item/imagequerybuilder.cpp
M  +7    -1    core/utilities/searchwindow/searchfields.cpp
M  +1    -0    core/utilities/searchwindow/searchgroup.cpp

https://commits.kde.org/digikam/2d199f612c4c428cedee0d4c3a8c647aba790f17
Comment 20 Maik Qualmann 2020-05-22 10:54:46 UTC
*** Bug 351987 has been marked as a duplicate of this bug. ***
Comment 21 Maik Qualmann 2020-05-22 10:56:29 UTC
*** Bug 421903 has been marked as a duplicate of this bug. ***
Comment 22 caulier.gilles 2020-08-03 05:21:35 UTC
digiKam 7.0.0 stable release is now published:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Best Regards

Gilles Caulier
Comment 23 Johannes 2020-08-16 16:22:40 UTC
Searching for Creator still works in 7.0.0. (tested with Appimage 64bit on Ubuntu 18.04.5).
Comment 24 caulier.gilles 2020-08-16 18:14:33 UTC
So the Q is : what's missing to close this file now ?

Gilles Caulier
Comment 25 Johannes 2020-08-16 18:51:54 UTC
I don't know why it wasn't closed already…
Comment 26 caulier.gilles 2020-08-17 10:30:28 UTC
Maik,

this file is not closed because plenty of bug entries ask to add search features over plenty of IPTC fields registered in database.

Right ?

Gilles
Comment 27 Maik Qualmann 2021-02-21 16:20:04 UTC
*** Bug 433391 has been marked as a duplicate of this bug. ***
Comment 28 Maik Qualmann 2021-02-21 16:22:29 UTC

*** This bug has been marked as a duplicate of bug 351987 ***