Announcement

#1 2022-04-13 01:18:03

DCStalls
Member
2022-03-25
10

Extension: Exiftool Keywords Documentation Help

Hello,

I am in the process of setting up a Piwigo gallery to allow family members share and collaborate on pictures from our ancestors.  I want to be able to use other software like Digikam to identify faces and pre-tag to make the "known" information more useful.  I am trying to use "Exiftool Keywords" to read existing tags from uploaded files but cannot find any documentation or instructions on how the extension is supposed to work.  I see random posts of users asking questions and using config settings but often not getting any reply.

The main tags I want to read from the files and import as Piwigo tags are:
- "Region Person Display Name"
- "XMP Keywords" or "Keywords"

Any insight on where there is documentation for this would be greatly appreciated.

===Environment===
Piwigo 12.2.0 Check for upgrade
Operating system: Linux
PHP: 7.2.34 (Show info) [2022-04-12 19:16:23]
MySQL: 10.3.34-MariaDB-log-cll-lve [2022-04-12 19:16:23]
Graphics Library: ImageMagick 7.1.0-2
Cache size N/A   never calculated Refresh

===Activated plugin list (13)===
Add < head > element
Advanced Menu Manager
Community
Contact Form
Crypto Captcha
gdThumb
Grum Plugins Classes.3
LocalFiles Editor
Mug Shot
RV Thumb Scroller
SmartAlbums
User Tags
Write Metadata

(Copy here your environment details, found on your Piwigo page [Administration > Tools > Maintenance])

Piwigo URL: https://fountain-family.com/gallery

Offline

 

#2 2022-04-13 11:22:05

erAck
Only trying to help
2015-09-06
2128

Re: Extension: Exiftool Keywords Documentation Help

As [extension by plg] Exiftool Keywords is just a smallish wrapper around a call to exiftool the best documentation for that might be its web site https://exiftool.org/ and specifically https://exiftool.org/#tagnames
To figure out tag names use exiftool -s filename.jpg
Add the tags you're interested in to your local config like in

Code:

$conf['ek_fields'] = array('Keywords', 'XPKeywords', 'RegionPersonDisplayName');

Note that 'RegionPersonDisplayName' doesn't have to be correct, I just made it up by omitting the blanks from your example, as programmatic tag names don't contain blanks (for that the option -s is used above).


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2022-04-14 11:03:14

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

Thank you for the reply.  You were correct with the fields.  How would I read these fields from the photo into Piwigo tags?

Offline

 

#4 2022-04-14 12:10:01

erAck
Only trying to help
2015-09-06
2128

Re: Extension: Exiftool Keywords Documentation Help

? the extension does that for all comma separated content of the configured Exif tags.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2022-04-14 12:48:20

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

Ok, so what is the trigger for that to occur?  I have uploaded new pics with these fields populated in the image and I have tried the metadata refresh but nothing shows up.

Offline

 

#6 2022-04-18 22:36:45

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

Just following up to see if anyone can provide some insight here.  I think this is a great platform and I understand the community here have regular jobs but I am struggling to understand how Piwigo is supposed to extract EXIF info into Piwigo tags.

Offline

 

#7 2022-04-18 23:09:27

erAck
Only trying to help
2015-09-06
2128

Re: Extension: Exiftool Keywords Documentation Help

Reading code I don't immediately see a reason why the Exif trigger doesn't deliver results. In include/functions_metadata.inc.php line 138 there's

Code:

  if ($exif = @exif_read_data($filename) or $exif2 = trigger_change('format_exif_data', $exif=null, $filename, $map))
  {
    if (!empty($exif2))
    {
      $exif = $exif2;
    }
    else
    {
      $exif = trigger_change('format_exif_data', $exif, $filename, $map);
    }

So if exif_read_data() fails then format_exif_data hooks are triggered and supposed to fill $exif2, which then assigned to $exif is used further. If exif_read_data() does not fail then $exif2 should be empty and an additional format_exif_data hook be executed, which here ek_format_exif_data() should assign extracted Exif fields to $exif['Keywords'].

If it doesn't I'd suggest to temporarily echo/log the content of $exif['Keywords'] after all assignments of $exif along with where (i.e. indicating in which branch it happened). Maybe that sheds some light.


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2022-04-19 05:26:44

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

Sorry for continuing to ask, how would I "temporarily echo/log the content of $exif['Keywords']"?

Offline

 

#9 2022-04-19 19:08:02

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

I also found another post about the plugin "Exiftool Keywords" using the command line exiftool.  How do I know if this is actually even working?

Offline

 

#10 2022-04-19 19:50:56

erAck
Only trying to help
2015-09-06
2128

Re: Extension: Exiftool Keywords Documentation Help

Before going into debugging details, could you provide a link to an image that should have keywords extracted but doesn't?


Running Piwigo at https://erack.net/gallery/

Offline

 

#11 2022-04-19 21:04:20

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

Offline

 

#12 2022-04-19 22:46:51

erAck
Only trying to help
2015-09-06
2128

Re: Extension: Exiftool Keywords Documentation Help

So fields containing the "Brian 2" tag/keyword are EXIF XPKeywords and IPTC Keywords and XMP Subject, LastKeywordXMP and LastKeywordIPTC. The RegionPersonDisplayName field is also XMP.

As iptc_keywords (field Keywords) is recognized as well, maybe add this to your local config:

Code:

// use_iptc: Use IPTC data during database synchronization with files
// metadata
$conf['use_iptc'] = true;

// use_iptc_mapping : in which IPTC fields will Piwigo find image
// information ? This setting is used during metadata synchronisation. It
// associates a piwigo_images column name to a IPTC key
$conf['use_iptc_mapping'] = array(
  'keywords'        => '2#025',
  'author'          => '2#080', // not 2#122, see https://piwigo.org/forum/viewtopic.php?pid=168381#p168381
  'name'            => '2#005',
  'comment'         => '2#120'
  );

That doesn't explain though why the Exiftool Keywords plugin's procedure doesn't add the XPKeywords content to keywords if it was executed at all. The PHP exif_read_data() function apparently did not extract XPKeywords, or it was overwritten/cleared after.

Or did you disable $conf['use_exif'] or have some odd mapping in $conf['use_exif_mapping'] in your local config?


Running Piwigo at https://erack.net/gallery/

Offline

 

#13 2022-04-20 01:51:25

DCStalls
Member
2022-03-25
10

Re: Extension: Exiftool Keywords Documentation Help

This what I have right now....

Code:

<?php

/* The file does not exist until some information is entered 
below. Once information is entered and saved, the file will be created. */

$conf['enable_i_log'] = true;

$conf['show_exif'] = true;

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

$conf['show_iptc'] = true;

$conf['show_iptc_mapping'] = array(
  'iptc_creator'         => '2#080',
  'iptc_title'           => '2#005',
  'iptc_headline'        => '2#105',
  'iptc_description'     => '2#120',
  'iptc_keywords'        => '2#025',
  );

$conf['use_exif_mapping'] = array(
  'date_creation'        => 'DateTimeOriginal',
  'comment'              => 'UserComment',
  );

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

$conf['ek_fields'] = array('Keywords', 'XPKeywords', 'RegionPersonDisplayName');

?>

Last edited by DCStalls (2022-04-20 01:53:04)

Offline

 

Board footer

Powered by FluxBB

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