Auto keyword function to add keywords based on filename...

B4535

Joined: 2014-01-31
Posts: 1
Posted: Fri, 2014-01-31 13:14

hi,

The critical point for me is NOT to have to re-enter one by one all the keywords attached to my images.
I think Gallery3 has a feature to use EXIF/IPCT fields to populate keywords that will let the visitor search.

It's great if you can confirm this.

Better for me would be if the filename of the image was also used to populate keywords.
All my photos filenames are based on this model: "1978 09 01 Paris Jean Martin. Jeanne Rousseau. Jardin .jpg"

Is this available in Gallery3 ?
If not, do you know a tool that could copy the filename into the EXIF/IPCT fields in batch mode ?

Thank in advance,
François

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2014-02-15 03:59

Yes, Gallery reads exif data if you activate the exif module.

The easiest (and best) way to do this is to edit the actual keywords field of exif before uploading.

If you really have to read the keywords from the filename (not recommended), I think that you can modify line 59 of the exif.php helper file of the exif module. (Don't change the original, just copy it and save it to your_theme > helpers > exif.php.) You'd have to have php read the filename (I think that you can use $item->file_path() for that) and explode the filename using a delimiter (probably a space in this case, but the spaces might've already been converted to hyphens by the time it's saved as file_path). Then take the result and combine it to any keywords that were stored (properly) in the keywords field.

You need to be sure to make sure that the value you're reading in isn't empty; and be sure to back up everything before experimenting.