Announcement

#1 2017-08-21 06:07:57

executive
Member
2017-08-16
1233

extending metadata

Hey guys.

First of all, a big thank you to all involved in the development of this software suite. I REALLY like Piwigo. I tried a lot of different web software, and I think this is the best gallery. Even compared to many cms packages out there, this is very well designed and powerful enough. I find it very intuitive and easy to learn to use.  The code is easy is understand, too.

The metadata integration is still a bit limited, but I'm sure it will evolve. It needs to be more user friendly for people to adopt it. Let me share with you some optimizations I have made so far. Right now, I primarily use Lightroom to edit and manage my photos, which is the main influence.

To other users, if you haven't yet discovered, there is some metadata functionality built into Piwigo already.  Some is on by default (For example, Piwigo will automatically set the photo's creation time to what was recorded by your camera), some just needs to be turned on and adjusted, and some requires more drastic changes. I recommend installing the "LocalFiles Editor" plugin to do so.

1. Showing exposure parameters. There is a camera info button above each photo, which will show some basic info, but it can be extended. Add these lines to your local config with the localfiles plugin:

Code:

$conf['show_exif_fields'] = array(
  'DateTimeOriginal',
  'Make',
  'Model',
  'ExposureProgram',
  'FocalLengthIn35mmFilm',
  'FNumber',
  'ExposureTime',
  'ISOSpeedRatings',
  'Flash',
  'WhiteBalance',
  'UserComment'
  );

(Of course there is more. Check out the "Read Metadata" plugin to find out more parameters.)

2.  Lightroom metadata. You might use LR to add additional information to your photos, such as: title, description, author, and keywords. When you develop and export your photos from LR, all this data is stored into the image using so called IPTC markers. Here is how you can incorporate this data into Piwigo. Once again in your local files editor, add these lines:

Code:

$conf['use_iptc'] = true;
$conf['use_iptc_mapping'] = array(
  'author'          => '2#080',
  'name'            => '2#005',
  'comment'         => '2#120',
  'keywords'        => '2#025',
  );

3. *EXPERIMENTAL* As of Piwigo 2.9.1 you cannot browse/filter your photos by author (even though this is already a database item just like tags) or EXIF metadata. I really wanted to be able to sort my photos by who took them, and what camera was used. To solve this, I added code which created tags out of author and camera names:

   i) Camera model tag. Add to local files editor:

Code:

$conf['use_exif_mapping'] = array(
  'date_creation'        => 'DateTimeOriginal',
  'tags'                 => 'Model',
  );

ii) Author tags. WARNING. Create a backup copy of this file in case you break something:
[piwigo root]/admin/include/functions_metadata.php
Then, look for this line:

Code:

 if (isset($iptc['keywords']))

and insert this code BEFORE it:

Code:

  // If author is present in IPTC, then copy it to tags (for searching)
  if (isset($iptc['author']))
  {
      $iptc['keywords'] = $iptc['keywords'].','.$iptc['author'];
  }

I hope this helps somebody. Hopefully, in future versions we'll be able to add more searchable properties to our photos. LR also exports names you have attributed to autodetected faces. It would be nice to use those too.

Last edited by executive (2017-08-21 06:38:21)

Offline

 

#2 2017-08-22 21:25:29

flop25
Piwigo Team
2006-07-06
7037

Re: extending metadata

Thanks for sharing
if Plg repair our wiki (because we can't administrate it since a whole) I would give you an access if you want ; the metadata page is quite old
whe you say "Hopefully, in future versions we'll be able to add more searchable properties to our photos" it's a wish or you found a commit in our Github?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2017-08-22 21:37:44

flop25
Piwigo Team
2006-07-06
7037

Re: extending metadata

ho i found a way to bypass the issue with our wiki En
So are you interesting in publishing your tips (no core file change however) and enhance the Documentation for the english community?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2017-08-22 23:36:54

executive
Member
2017-08-16
1233

Re: extending metadata

Sure, I can add some tips to the wiki.

The photo properties is a big wish for me, and probably others. I can register it on Github if that would help. I would love to assist, but my understanding of Piwigo core is still limited, and my PHP/SQL is not super strong.

Offline

 

#5 2017-08-23 21:51:26

executive
Member
2017-08-16
1233

Re: extending metadata

Au fait, je parle/ecris Francais aussi (Quebecois, malheureusement) Si vous avez besoin des traductions Fr->En , je peux vous aider avec ca.

Offline

 

#6 2017-08-23 22:04:34

flop25
Piwigo Team
2006-07-06
7037

Re: extending metadata

Ha ! super Bienvenue cher cousin éloigné ^^
La Doc Fr étant bien plus complète je pense que ça peut déjà bien aider pour transposer et créer des pages. Ecrire la doc est rébarbatif et pas gratifiant (je le sais très bien car j'ai écrit et rangé une bonne partie de la Doc En) mais cela aiderait la communauté En qui grandit
D'ailleurs merci beaucoup de répondre sur el forum C’est très gentil et fort utile


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2018-05-20 06:30:09

dd-b
Member
Minneapolis, MN USA
2018-04-16
70

Re: extending metadata

Unfortunately this has a fatal flaw; the $iptc hash is initialized via get_iptc_data() using $conf['use_iptc_mapping'] -- which means any name you assign to an iptc field in that hash also tries to insert into the database.  So you can only use the names of real fields in that table, and whatever you put there is what will go in the database.  So it's not usable for grabbing some other field like say the IPTC city field 2#090 and turning it into an additional tag field. (I was intending to turn city into a tag "city:<value>", and similarly for a number of other fields, but no dice.)

And based on what tool/metadata.php sees, the underlying IPTC code in PHP 5.6 doesn't see a bunch of fields I've been used to using for "forever", however long that actually is (years, anyway). 

Warning:  [mysql error 1054] Unknown column 'supplemental' in 'field list'

UPDATE piwi_images
  SET filesize = '334',
    width = '1620',
    height = '1080',
    date_creation = '2018-04-01',
    author = 'Lynn Anderson',
    name = 'DCP_0005',
    supplemental = 'SFCON=Minicon 53',
    date_metadata_update = '2018-05-19 21:19:16'
  WHERE id = '1602' in /home/dh_akhcfg/gal01.dd-b.net/piwigo/include/dblayer/functions_mysqli.inc.php on line 845

Offline

 

#8 2018-05-20 06:38:11

executive
Member
2017-08-16
1233

Re: extending metadata

of course, you cannot map to image properties that don't exist.

I would hardly call that "fatal".

Offline

 

#9 2018-05-20 17:42:47

dd-b
Member
Minneapolis, MN USA
2018-04-16
70

Re: extending metadata

Well, I started by saying lack of location properties was pretty close to fatal in and of itself. Now it appears I can't even use this technique to map them into tags.  Who the heck has photo collections where location doesn't matter?

Offline

 

#10 2018-05-20 20:27:00

executive
Member
2017-08-16
1233

Re: extending metadata

dd-b wrote:

lack of location properties was pretty close to fatal

I see. So you die if you don't know where a photo was taken? That's rough.

dd-b wrote:

lWho the heck has photo collections where location doesn't matter?

* raises hand *
I know where I've been. For the odd photo where I want to add a few notes, I'll use the title or description which work just fine in Piwigo.

Also, did you try searching the forum?
There is an extensions that allows you to add more image properties:
http://piwigo.org/forum/viewtopic.php?id=28689
I think you'll have to enter them manually, but if you figure out a way to automate it, then please let us know.

Last edited by executive (2018-05-20 20:33:58)

Offline

 

#11 2018-05-21 17:13:16

flop25
Piwigo Team
2006-07-06
7037

Re: extending metadata

The OSM plugin read the locations metadata and display them on a map
I d'ont get what's your point here


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#12 2018-05-21 20:37:44

executive
Member
2017-08-16
1233

Re: extending metadata

I don't think this person does a great deal of research before they post.

Offline

 

#13 2019-08-06 16:19:39

dd-b
Member
Minneapolis, MN USA
2018-04-16
70

Re: extending metadata

Having given it (um, me) more than a year to cool off, I can only say that I frequently search Flickr or various stock collections by location, and frequently search my own photos by location.  Sure, I generally remember where I've been, but not necessarily exactly when, or how many times. The point of a good index is to help people go from the bits they do remember to related information. If one assumes people have perfect memories, one doesn't need an index (at least for their own information).

Which brings us to the second point.

The Piwigo gallery I'm working on (in the intervening year we've pretty much decided we are using Piwigo to implement this) is for an archive of photos by multiple photographers covering most of a century (and growing) that we want to be accessible to researchers and students in the field.  Questions like "what do we have from conventions in Minnesota in the 1960s" and "What authors were associated with Nebraska in the 1970s" are exactly the sorts of things people will want to find.

Finally, the deliberate misreading to suggest that I think my own life is endangered, rather than the viability of Piwigo for the project, is not a good look.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact