Announcement

#1 2018-09-11 20:45:28

RegSputnik
Member
2018-09-11
5

Manage Properties Photos

Hi

Does an example exist of how to create new properties using this plugin? Or can someone explain?

The plugin shows / hides and orders existing photo properties well, but I'm hoping to display some extra IPTC data with with the standard 'Author, keywords' etc and can't figure out how to do that.

I thought the plugin would create a new database header, and that I could then map my desired IPTC key to that new header using the config file (I've successfully mapped other IPTC data which shows when the "show fle metadata" button is pressed).

However, I'm not sure what is meant by 'use extended description tags' in the input box.

If I enter, for example, 'photographer' as a new photo property and map that field to 'iptc_creator using the config file, when I attempt to synchronize my images 'photographer' is rejected as not being a database field.

Have I misunderstood how the plugin works?

Thanks for any help.

Offline

 

#2 2018-09-12 07:27:06

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6733

Re: Manage Properties Photos


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2018-09-12 12:33:58

RegSputnik
Member
2018-09-11
5

Re: Manage Properties Photos

Hi

Lovely to have such a quick reply - and from the plugin author! :)

Thanks for the link. I have, indeed, read this many times and it's helped me to create a custom list of ITPC data on my photo pages. (I have a suggestion about this document later *)

But when it comes to your plugin, I need a little more help, please.

I can see, from looking at the SQL database, that the plugin adds rows to the piwigo_add_properties_photos table. So if I use the plugin to create a new property, (e.g. by typing 'My New Property' in the input box ) it appears in the table (see attached PDF).

But how do I bind the 'My New Property' field to an IPTC key so it will display on my photo page?
Do I need to type something else in the input box?

Thank you for any help you can offer.


* Suggestion for 'Metadata' Documentation

I think readers may be confused (I was!) by the term 'Example' in the extract of the document, below.

I concluded, if this was an 'example' there must be OTHER Piwigo fields I could map to. (It's not just me that has been confused - other users have asked for a 'full' list of mappable fields). But, AFAIK, the fields in the 'example' below are the ONLY ones designed to hold IPTC data.

I wonder whether changing the text to something like:

'Piwigo has four fields which can be mapped to import IPTC data (often added using Adobe Lightroom)'

and adding an image of the piwigo_images table (PDF attached), showing exactly which fields are available, would help readers understand this? :)

-----------------------

Example of extended mapping which imports IPTC metadata (often added using Adobe Lightroom) into corresponding Piwigo fields:

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

Offline

 

#4 2018-09-12 13:06:57

RegSputnik
Member
2018-09-11
5

Re: Manage Properties Photos

Oops, can't upload PDFs!

JPEGS of piwigo_add_properties_photos and piwigo_images tables attached - hopefully! ;)


Uploaded Images

Offline

 

#5 2018-09-12 20:38:00

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6733

Re: Manage Properties Photos

Hi :-)

The plugin don't schow IPTC or exif


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2018-09-12 20:38:29

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6733

Re: Manage Properties Photos

RegSputnik wrote:

Oops, can't upload PDFs!

JPEGS of piwigo_add_properties_photos and piwigo_images tables attached - hopefully! ;)

no !


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2018-09-13 03:58:24

executive
Member
2017-08-16
374

Re: Manage Properties Photos

Author of the metadata document here.

The code is an example of the many different metadata fields you can map FROM. Right after the section you quotes is a paragraph:

Limitations

There are limits to the metadata usage in Piwigo. There are only so many image properties in the standard Piwigo database, and core code to use it ... we can't use all IPTC or Exif metadata, because there is no place to put it.

The article is intended for the layperson, and I think showing SQL tables is too much.

It appears to me from your screenshot that there are more than four image properties that can be used. For example, latitude.

Offline

 

#8 2018-09-13 14:08:03

RegSputnik
Member
2018-09-11
5

Re: Manage Properties Photos

Hi, thanks for your quick reply. Great to be talking to the author! :)

I really appreciate the work that has gone into Piwigo (I now use it in preference to both Zenfolio and Smugmug commercial software). I hope I don't sound critical. I'm only looking help other users. :)

Yes, I think you're right about not showing SQL tables. It is too much. What I was really seeking to do was to show readers a full list of the Piwigo fields which can import (or export) IPTC metadata.

When I first read the Metadata document, I thought "great I can import IPTC data!" Then I thought, "I wonder how many fields I can import? 5? 10? 20? 50?"

At this point, though, I hit a brick wall because I couldn't discover how many Piwigo fields could accept data, or what the Piwigo field names were. Yes, the following 'limitations' paragraph warned me I couldn't import all IPTC fields, but I what I wanted to know was how many fields I could import. I've had to delve into the mysteries of SQL tables (strange new territory for me!) to discover the answer.

So, I feel it would really help readers if the Metadata document contained (or linked to):
1) A list of all the Piwigo fields that can store IPTC data (as it's the IPTC section).
2) More generally, a list of all the Piwigo fields that can store any image data.

What do you reckon?

P.S. Does this need to be bumped to a different subject - I'm aware I've strayed off the original topic!

Offline

 

#9 2018-09-14 08:18:02

executive
Member
2017-08-16
374

Re: Manage Properties Photos

As the document says,

- Image properties can be viewed by clicking its thumbnail.
- Searchable properties are shown in Batch Manager.
- Rules/Filters can be set up with the Smart Albums extension.

It might be possible to do more with custom extensions/templates.

Offline

 

#10 2018-09-26 21:10:29

wernfried
Member
2012-01-21
80

Re: Manage Properties Photos

You can use (i.e. display) any exif tag when you integrate exiftool  to your Piwigo.  Go to LocalFiles Editor and create a personal Plugin.

This example adds "m" for metres to exif tag "ApproximateFocusDistance".

Code:

<?php
/*
Plugin Name: Invoke exiftool
Version: 1.0
Description: Running external "exiftool" from Piwigo
Plugin URI:
Author:
Author URI:
*/

add_event_handler('format_exif_data', 'ir_format_exif_data');

function ir_format_exif_data($exif, $filepath) {
  if (!function_exists('shell_exec')) { //check if function is not available
    die('shell_exec is disabled. check php.ini');
  }
  $output = shell_exec('$HOME/Image-ExifTool-10.75/exiftool -json "'.$filepath.'"'); //execute external and get the response to variable
  $exiftool_metadata = json_decode($output, true); //convert json to array
  $exif['EXIFTOOL'] = $exiftool_metadata[0]; //add exiftool_exif to php_exif

  if (array_key_exists('ApproximateFocusDistance', $exif['EXIFTOOL'])) {
      $exif['EXIFTOOL']['ApproximateFocusDistance'] = $exif['EXIFTOOL']['ApproximateFocusDistance']." m";
  }

  //print('<pre>'.print_r($exif,true).'</pre>'); //debug, help for exif configuration
  //print('<pre>'.print_r($exif['EXIFTOOL'],true).'</pre>'); //debug, help for exif configuration

  return $exif;
}

?>

Then you can display any exif data like normal properties. Edit your local config.inc.php, e.g.


Code:

$conf['show_exif_fields'] = array(
  'EXIFTOOL;ApproximateFocusDistance',
  'EXIFTOOL;DOF',
  );

You can also localize tag names, e.g.

Code:

$lang['exif_field_ApproximateFocusDistance'] = 'Ungefähre Fokus Distanz';
$lang['exif_field_DOF'] = 'Schärfentiefe';

However, if you need to put the exif data to your database for whatever purpose then you have to look for a different solution. This plugin just displays desired exif data.

Best Regards

Last edited by wernfried (2018-09-26 21:11:49)

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact