EXIF contributions

pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sun, 2009-07-19 01:19

Core team:

I am going to try to tackle some of the open EXIF issues that have been put in the "Field of Dreams" category on Trac.

To help get me started, can you point me to the specific code that is involved with
1) loading data from the EXIF "keywords" field into the DB as a series of tags
2) the syntax of the SELECT statement(s) used when the Search module is invoked

Also, if you ran into any issues that made you think these tickets would be particularly hard to resolve, can you shed some light on hat you found so I don't try to reinvent the wheel?

Thanks. Hopefully I can make this work!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-07-19 03:00

1) G3 does this already with IPTC keywords. Take a look at /modules/tag/helpers/tag_event.php

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sun, 2009-07-19 03:07

Thanks. I know the module already creates tags. My goal is to make EXIF information searchable. One possible way to do this would be to make the tags searchable, so seeing how they are created might help me get started.

Alternatively, I could look into loading the keywords into the EXIF field in the database, then making that entire field searchable. I suspect this approach will be a lot harder, but it more closely matches the functionality that I (and a few others) were looking for.

 
hiwilson

Joined: 2009-06-23
Posts: 10
Posted: Sun, 2009-07-19 04:33

Hi pinn8, I think I am your friend. I also want to make tags to be searchable. My understanding to make it work is to add a "tag_search.php" file into modules/tag/helpers. You may refer modules/gallery/helpers/gallery_search.php to see how to use.

Actually, I have already made it, but still testing before pushing to GIT. You may wait a while if you can.

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sun, 2009-07-19 10:50

@hiwilson -- That's great. I will wait to see what you have come up with for searching tags and move on to some of the other EXIF tickets, like including the latitude and longitude tags in the database. Let me know if you need any help.

 
hiwilson

Joined: 2009-06-23
Posts: 10
Posted: Sun, 2009-07-19 15:14

I have pushed the tag_search.php into GIT. You can have a try. http://github.com/hiwilson/gallery3/commit/32e3952e78e1d0007df1e1a8db2ad9ba395277dd

At the same time, you need to add one more function of get_tags() into modules/tag/helpers/tag.php to make above commit work. It is stated at http://github.com/hiwilson/gallery3/commit/a5eef648c00ec3ddee40ebd716380ae0a50e90e7 (2nd part of modules/tag/helpers/tag.php changes)

 
yeahy

Joined: 2008-11-07
Posts: 69
Posted: Sun, 2009-07-19 19:49

Oh, I'm very very interested to store latitude and longitude info and other EXIF info in the database to make these info to be searchable. I'm in.

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sun, 2009-07-19 21:25

@hwilson -- This is great -- one more item off my list of EXIF and tag-related tweaks. I would love to see this make its way into the core build.

One minor issue I noticed is that the tags are not listed in the search_records table for images that are already in the database. This was easy to solve -- I just flagged all images as "dirty" in that table and ran the re-index maintenance task. It would be better, however, if there were a maintenance task to force a re-index of all images (I realize this task is somewhat out of scope for what you set out to do).

 
hiwilson

Joined: 2009-06-23
Posts: 10
Posted: Mon, 2009-07-20 01:20

Thanks bharat! He accept our request to make tag to be searchable in ticket #573.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-20 19:07

Making tags searchable is fairly straightforward since the tag names are all relatively unstructured data. Doing it for EXIF is a little harder because you'd probably want to do a structured search. Can you tell me what scenarios you have in mind for EXIF search?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Mon, 2009-07-20 19:28

Bharat -- my goal in searching EXIF was primarily to make the keywords searchable. We seem to have a solution for that with searchable tags. so I am OK there. I have heard others express an interest in organizing images based on lenses, camera bodies, etc.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-20 22:23

Ok. If somebody expresses some good use cases for search and is prepared to get their hands dirty with the code, I'll help you get it set up right. hiwilson has already done some good work in extending our regular album/photo/movie editing code and is knowledgeable about how to make it work, so perhaps you guys can put your heads together.

hiwilson, I'd suggest a similar event-driven approach for extending search as you did with item editing. Take a look at the finished approach I did to see what I'm driving for-- I worked to create more APIs (even at a minor performance impact) to keep the code simple and maintainable.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
hiwilson

Joined: 2009-06-23
Posts: 10
Posted: Tue, 2009-07-21 00:28

um... but I only have one Canon compact camera. I have not much interest at this part at this moment.

@bharat, thanks for your code editing. It looks quite nice!

 
yeahy

Joined: 2008-11-07
Posts: 69
Posted: Tue, 2009-07-21 13:07

Thanks bharat. Same to pinn8, my goal is to make EXIF information searchable also, include "keywords(tags)", "Artist", "latitude/longitude" and "Lens info".

Use case of "latitude/longitude"(priority: major important): An user'd like to check other photos shot at nearby location of current photo which he's viewing. Then he may trigger a search. The current search result page UI is good enough. Gmap module can provide map UI, but that's another part. I think it's good that all EXIF meta data are managed together and searchable together.

Use case of "Lens info"(priority: less important): I like photography and have a DSLR. So I'm very interested to see what image that a specific camera (e.g. Canon flagship model: 5D2 ) or lenses can provide. So I'd like to search the 'Camera Model' or 'Lens Type' column within the EXIF to list all related photos.

Use case for "Artist" (less important): The uploader is not the author, e.g. the author died several or dozens of years ago.

So there're 3 methods to trigger a search (We needn't impletment all methods at once): 1) Users type specific content in the search box. 2) Provide some links to let the users easily explore other photos with same artist or camera/lens or nearby latitude/longitude. 3) Mainly for tags: tags/keywords click.

I need some time to figure out how the existing codes work.