Announcement

#1 2016-05-12 10:17:57

gandycz
Member
2015-03-29
17

Search metadata

Hello/Hi/Greetings,

Is there any way to search in metadata info? You know I want to show certain photos taken by specific lenses... Usefull for photographers.

Piwigo version: 2.8.1
PHP: 5.5.31
MySQL: 5.6.20
Piwigo URL: http://iphoto.macweb.cz

Offline

 

#2 2016-05-12 15:46:56

teekay
Member
2013-06-12
304

Re: Search metadata

You can, read http://piwigo.org/doc/doku.php?id=user_ … n:metadata

Then take a look at include/config_default.inc.php to get an example for mapping the exif/iptc data into the database. By default only date_created is mapped.

Code:

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

// use_exif_mapping: same behaviour as use_iptc_mapping
$conf['use_exif_mapping'] = array(
  'date_creation' => 'DateTimeOriginal',
  'camera_make' => 'Make',
  'camera_model' => 'Model',
  'lens_model' => 'UndefinedTag:0xA434'
  );

Offline

 

#3 2016-05-12 17:19:36

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13093

Re: Search metadata

hum... field "piwigo_images.camera_make" does not exist, so it won't work very well.


Latest blog post (November 28th 2017) Server failures in october and november 2017

Offline

 

#4 2016-05-12 17:57:47

teekay
Member
2013-06-12
304

Re: Search metadata

plg wrote:

hum... field "piwigo_images.camera_make" does not exist, so it won't work very well.

Oh. Then I totally misread the wiki article, and obviously I didn't read the comment at use_iptc_mapping in config_default.inc.php. Sorry.

But such a "free" mapping would really make for a great feature. +1

Offline

 

#5 2016-05-12 18:41:22

gandycz
Member
2015-03-29
17

Re: Search metadata

Thx that's the think I need to do. Ok starting up the local editor and get on.

Offline

 

#6 2016-05-12 18:48:43

gandycz
Member
2015-03-29
17

Re: Search metadata

teekay wrote:

You can, read http://piwigo.org/doc/doku.php?id=user_ … n:metadata

Then take a look at include/config_default.inc.php to get an example for mapping the exif/iptc data into the database. By default only date_created is mapped.

Code:

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

// use_exif_mapping: same behaviour as use_iptc_mapping
$conf['use_exif_mapping'] = array(
  'date_creation' => 'DateTimeOriginal',
  'camera_make' => 'Make',
  'camera_model' => 'Model',
  'lens_model' => 'UndefinedTag:0xA434'
  );

After this is there way to import existing information from already existing photos into DB?

Offline

 

#7 2016-05-12 20:01:42

teekay
Member
2013-06-12
304

Re: Search metadata

No, it was nonsense. Please disregard my post.

Offline

 

#8 2016-05-13 10:38:47

gandycz
Member
2015-03-29
17

Re: Search metadata

teekay wrote:

No, it was nonsense. Please disregard my post.

OK

Offline

 

#9 2016-05-13 21:18:23

eliz82
Member
Romania
2016-04-27
196

Re: Search metadata

gandycz wrote:

Is there any way to search in metadata info? You know I want to show certain photos taken by specific lenses... Useful for photographers.

Of course is useful. Probably they are many users who want to do the same thing for their Piwigo gallery. Including me and including Piwigo developer team member rvelices seems that already done something like this: http://www.modusoptimus.com/pwg/index/equipment

I will split the discussion about exif in two chapters:
I) Display the lens name in the exif field under the picture.
II) To have the possibility to make dynamic categories or search links with a certain Camera, Lens
a) in a manual way
b) in an automatic way


I) About display the lens name has been recently discussed http://piwigo.org/forum/viewtopic.php?p … 29#p163129
Read the entire discussion.

Basically showing exif LensName or LensId is not an easy thing because:
- the lack of standardization before EXIF 2.3 which came out in 2012. Because in EXIF 2.2 LensName had not have a standardized tag address, before 2012 every maker put their LensId AND/OR LensName in their Makerdata at a different tag address.
- Piwigo using PHP exif module ( http://php.net/manual/en/function.exif-read-data.php ) witch can read the pictures exif data in a limited way. They are PHP libraries that are better at this. For example this plugin http://piwigo.org/ext/extension_view.php?eid=364 is using libraries

After 2012 I think all makers started to use the the EXIF 2.3 standardized address, so if you have a modern camera you should be easy to show. I recommend you to use the tool implement in the Piwigo http://yoursite.com/piwigo/tools/metadata.php copy a picture of yours as sample.jpg in the same directory and check what data is PHP exif module is capable to see.

For example for my Canon cameras this what i got from my investigation with metadata.php:
(case 1) IF (Camera is Any Marker made after 2012) and (the tag have not been stripped by the PC editing software) => you will find your LensName at [UndefinedTag:0xA434] tag
(case 2) IF (Camera is Canon made before 2012) and (the tag have not been stripedd by the PC editing software) and (the Lens is a modern one) => you will find your LensName as string at address at [UndefinedTag:0x0095] tag
(case 3) IF (Camera is Canon made before 2012) and (the tag have not been stripped by the PC editing software) and (the Lens is a old one) => you will find your LensID as integer at somewhere in the [ModeArray] or [ImageInfo], the array key is depending by the camera model

II a) Showing picture categories based on Camera Maker or LensName with user entering the data by hand:

-Using Piwigo included tag/keyword functionality and add the LensName by hand using Batch Manager
-Using the new Search Links plugin http://piwigo.org/ext/extension_view.php?eid=825 . Add the data manually to photo description then use a plugin to make a page with a list of search links. I think this is the method rvelices is using at http://www.modusoptimus.com/pwg/index/equipment
-Using plugin Manage Properties Photos to add a new field to photos http://piwigo.org/ext/extension_view.php?eid=783 . I'm not sure this plugin is compatible with Search Links or Keyword functionality. So i'm not sure you can generate dynamic categories with this

II b) Showing picture categories based on Camera Maker or LensName with data inserted automatic by software

gandycz wrote:

After this is there way to import existing exif information from already existing photos into DB?"

I don't think that functionality exist in Piwigo or any extension ... maybe except RV Maps or Openstreet plugin? I think they are importing the exif GPS coordinates in the database, otherwise it will be hard to read realtime all photos exif gps data every time the map with all pictures is displayed. Again rvelices know this better as is the author of that plugin.

But I think an extension like this can be made for Piwigo by someone with enough skills. It is technically possible to mass (batch) search the all pictures in the gallery and injecting Exif data like Camera Model/Camera Maker/LensName into the database as tags/keywords.

Menalto Gallery2 had some kind of similar functionality to import some data into tags, or mass search exif gps data and add it into the database.


Uploaded Images

Last edited by eliz82 (2016-05-13 23:21:08)

Offline

 

#10 2016-05-14 06:15:28

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

Re: Search metadata

eliz82 wrote:

I recommend you to use the tool implement in the Piwigo http://yoursite.com/piwigo/tools/metadata.php copy a picture of yours as sample.jpg in the same directory and check what data is PHP exif module is capable to see.

Hi :-)

You can use [extension by ddtddt] read_metadata


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

 

#11 2017-08-19 09:54:01

executive
Member
2017-08-16
47

Re: Search metadata

Maybe it's possible to map EXIF camera/lens values as another tag.

Offline

 

#12 2017-08-30 07:58:03

eliz82
Member
Romania
2016-04-27
196

Re: Search metadata

executive wrote:

Maybe it's possible to map EXIF camera/lens values as another tag.

That is what I have also proposed.

Piwigo already make something similar with GPS coordinates from exif. GPS coordinates are the only values from the exif that are written into the database, and used by the plugins to show pictures on the map.

Last edited by eliz82 (2017-08-30 08:00:39)

Offline

 

#13 2017-08-31 05:39:37

executive
Member
2017-08-16
47

Re: Search metadata

I have implemented a temporary solution. See here:
http://piwigo.org/forum/viewtopic.php?id=28203

Offline

 

#14 2017-09-01 09:31:10

eliz82
Member
Romania
2016-04-27
196

Re: Search metadata

so iptc keywords are already imported by piwigo? and you added another iptc parameter to import list.
but this means i must manually add the lens name and camera model into all my photos iptc keywords. so i need to find a program that can do this in batch mode (faster then you can add tags to photos in Piwigo).

maybe we can find a software that can automaticly import Camera model from exif to iptc keywords. For lens name i doubt such a program exist because of lack of standardization before exif 2.3 . phil harvey exiftool is the only software that has serious support for determining lens name in exif 2.2 .
maybe i should make on thread in exiftool forum and ask phil if is possible to import lens name from exif to iptc keywords.

Offline

 

#15 2017-09-01 21:59:22

executive
Member
2017-08-16
47

Re: Search metadata

> so iptc keywords are already imported by piwigo?
No. You need to enable it as I show in my post.

>and you added another iptc parameter to import list.
list? not sure ....

> i must manually add the lens name and camera model into all my photos iptc keywords.
No. The code that I provided takes the camera model (which your camera automatically saves to EXIF block) and maps it to the piwigo 'tags' key.  I was able to do it this way, because 'tags' is unmapped by default so it was available to use. I think that later in the core code the IPTC 'keywords' and EXIF 'tag' keys are combined, but I can't remember exactly. Anyway seems to work. I don't think you can map two values to a key, so grabbing the lens name would be more complicated. I don't know who Phil is, but if he can help then by all means ask him.

I think the ideal solution would be a plugin which writes camera and lens names to the keywords/tags in the piwigo database.

Last edited by executive (2017-09-01 22:05:08)

Offline

 

Board footer

Powered by FluxBB

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