ZenphotoCMS Forum
Adding more EXIF fields - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Adding more EXIF fields (/thread-12348.html)



Adding more EXIF fields - lolliffe - 2015-10-24

Following an older post: http://www.zenphoto.org/support/topic.php?id=11768
I tried to add metadata fields with only partial success.

From exiftool tag names (source: exiftool site), I found:
"©cmt" Comment

While running exiftool, I got the following two results:
exiftool json output
"Comment": {
"desc": "Comment",
"id": "?cmt",
"val": "Comments go here"

exiftool -G output
[QuickTime] Comment : Comments go here

Using that information, I added (some whitespace removed here):
'VideoComment' =array('QuickTime', 'Comment', gettext('Video Comment'), false, 256, true, 'string'),
after the other Video tags, in the functions.php file.

Going into options, "Video Comment" appears in the metadata list, but enabling it doesn't produce any display. I tried with both GD and Imagick, and refreshed the metadata, but they never show with the other Video metadata.

Config info:
ZP 1.4.10 [3d5be820ca]
PHP Imagick library 3.1.0RC1
ImageMagick 6.6.9-7 2014-03-06 Q16
MySQLi version: 5.5.44
PHP version: 5.3.10-1ubuntu3.20
Current gallery theme: Libratus

Thanks for any advice

P.S. I'm getting messages that my functions.php file seems wrong, although everything is working except for my new metadata.




Adding more EXIF fields - acrylian - 2015-10-24

Zenphoto users this libary for meta data reading of multimedia files:
http://getid3.sourceforge.net
It might be that this container format which is proprietary is not fully supported. I don't know that offhand. You can preview what it can read here (note we do not include all modules currently but only those we have plugins for):
http://www.getid3.org/demo/

In any case I would recommend to use normal mp4/m4v videos instead of Quicktime and jPlayer because modern browser do support these natively. Quicktime is not really the common container format it was years ago anymore.




Adding more EXIF fields - fretzl - 2015-10-25

Adding this line works for me:
'comment' =>array('VIDEO', 'comment', gettext('Video Comment'), false, 256, true, 'string'),
Note 1: if fields are added or deleted, setup should be run or the new data won't be stored.

Note 2: if zp-core files are changed you'll get the the message you mentioned.

Note 3: if you change zp-core files you'll have to apply your changes again after every update.




Adding more EXIF fields - lolliffe - 2015-10-26

@acrylian - They actually are mp4/m4v files, but the TAGS, are listed under the "QuickTime" grouping, similar to how other image information may be under the "EXIF" tag, or the "IPTC" tag, depending.

@fretzl - Thanks! I'll try running setup. I hadn't tried that. I'll report back, when I get a chance.




Adding more EXIF fields - acrylian - 2015-10-26

Ah, ok, thanks.




Adding more EXIF fields - lolliffe - 2015-10-26

This worked!

I'm still having trouble pulling "Composer", "TV Show", and "TV Episode ID", which I thought that I had pulled before with getID3, but I've been able to add Comment, Genre, and Description to my ZP display, and that's a big help.

For others, after editing the functions.php file, I re-ran the setup, then did a "Refresh metadata" (I don't know if it's needed, but I did it anyway), and then went to Options>Images, and enabled the new tag in the Metadata list.

The new tag in the Metadata list, seems like it can be whatever you like. It's the text that you enter in between the quotes (the argument), in the 'gettext' function.
Example: gettext('My new tag'), ...

Hope this is helpful to others, and if anyone has any suggestions on getting my missing items, I'd love to hear them.




Adding more EXIF fields - fretzl - 2015-10-27

FYI: I got my information from the function CopyToAppropriateCommentsSection() starting on line 2105 in .../zp-core/zp-extensions/class-video/getid3/module.audio-video.quicktime.php

There you can see how QuickTime metadata field-names are mapped to more readable field-names for internal use.




Adding more EXIF fields - lolliffe - 2015-10-29

I checked that out, but I'm still not sure why some fields show, but others don't.

For examples:
This works
'VideoGenre' => array('VIDEO', 'genre', gettext('Genre'), false, 256, true, 'string'),
...but this doesn't
'VideoComposer' => array('VIDEO', 'composer', gettext('Composer'), false, 256, true, 'string'),

Similarly, this works
'VideoTVshow' => array('VIDEO', 'tv_show_name', gettext('Show'), true, 256, true, 'string'),
...but this doesn't
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Episode'), false, 256, true, 'string'),

Thanks for the lead, though. At least now I'm not guessing at what the field-names are. ;-)




Adding more EXIF fields - lolliffe - 2015-11-13

Anyone have any other suggestions on why some of the fields in the above post show, while related ones don't? As mentioned, 'tv_show_name' works, but 'tv_episode' doesn't.

Thanks




Adding more EXIF fields - acrylian - 2015-11-13

I have to admit I never used this functionality. Are these fields really set in the database correctly?

Just a note beforehand that in the next bigger version this whole handling of extra fields may change a bit (can't tell details). But that will be a while in the future ;-)




Adding more EXIF fields - fretzl - 2015-11-13

We just updated the getID3 library and noticed some changes that [i]may[/i] affect the very fields you need.
So please give the Support build a try.




Adding more EXIF fields - lolliffe - 2015-11-17

Thanks for the Support build. More tags are definitely showing up now. For example, although it does not show up in the Image Metadata list (no check box for "Composer", but it's showing up in the Image Info on the Image page. (Substitution, or mapped to another item, like 'artist'?)

This is how it appears in the functions.php file
'VideoComposer' => array('VIDEO', 'composer', gettext('Composer'), false, 256, true, 'string'),

The episode info
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Episode'), false, 256, true, 'string'),
still isn't appearing in the Image Info.

And none of the sort_... items ( module.audio-video.quicktime.php, starting at line 2202 ) are appearing in the Image Info.




Adding more EXIF fields - fretzl - 2015-11-17

Just discovered and corrected a typo in module.audio-video.quicktime.php
This probably affects the display of tv_episode.
Please try the Support build again.

I'm afraid I can't help with your other questions but you could try the getID3 forum or GitHub




Adding more EXIF fields - lolliffe - 2015-11-25

I tried the Support build, and I see the typo, and why that might have changed things, but it's still the same.

If you want to look, http://hdl.handle.net/10020/metaTest click the Metadata Test Movie. I have a PDF of my functions.php file, a jpg of the items selected in Image>Metadata, and a movie file that lists all of the embedded metadata in the description, and I think you can even download it, if you want to use it for testing.




Adding more EXIF fields - acrylian - 2015-11-25

It still might be that the getID3 libary does not import your tv_episode field respectively all fields from the movie itself. Did you see the getID3 website for info what exactly it imports? To my knowledge it is often limited on some formats.




Adding more EXIF fields - fretzl - 2015-11-25

Apparently tv_episode needs to be parsed as a [b]number[/b] otherwise it breaks the code.

So I changed

'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 256, true, 'string'),
to

'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 32, true, 'number'),
I added the "list" below to functions.php and the only tags that still do not show up are sort_title and sort_album_artist.

'VideoLyrics' => array('VIDEO', 'lyrics', gettext('Video Lyrics'), false, 256, true, 'string'), 'VideoComment' => array('VIDEO', 'comment', gettext('Video Comment'), false, 256, true, 'string'), 'VideoComposer' => array('VIDEO', 'composer', gettext('Video Composer'), false, 256, true, 'string'), 'VideoAlbum' => array('VIDEO', 'album', gettext('Video Album'), false, 256, true, 'string'), 'VideoAlbumArtist' => array('VIDEO', 'album_artist', gettext('Video Album Artist'), false, 256, true, 'string'), 'VideoGrouping' => array('VIDEO', 'grouping', gettext('Video Grouping'), false, 256, true, 'string'), 'VideoDescription' => array('VIDEO', 'description', gettext('Video Description'), false, 256, true, 'string'), 'VideoGenre' => array('VIDEO', 'genre', gettext('Video Genre'), false, 256, true, 'string'), 'VideoTVshow' => array('VIDEO', 'tv_show_name', gettext('Video TV Show'), false, 256, true, 'string'), 'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 32, true, 'number'), 'VideoTVepisodeID' => array('VIDEO', 'tv_episode_id', gettext('Video TV EpisodeID'), false, 256, true, 'string'), 'VideoSortTitle' => array('VIDEO', 'sort_title', gettext('Video Sort Title'), false, 256, true, 'string'), 'VideoSortAlbum' => array('VIDEO', 'sort_album', gettext('Video Sort Album'), false, 256, true, 'string'), 'VideoSortArtist' => array('VIDEO', 'sort_artist', gettext('Video Sort Artist'), false, 256, true, 'string'), 'VideoSortAlbumArtist' => array('VIDEO', 'sort_album_artist', gettext('Video Sort Album Artist'), false, 256, true, 'string'), 'VideoSortComposer' => array('VIDEO', 'sort_composer', gettext('Video Sort Composer'), false, 256, true, 'string'), 'VideoSortShow' => array('VIDEO', 'sort_show', gettext('Video Sort Show'), false, 256, true, 'string'),




Adding more EXIF fields - lolliffe - 2015-11-25

Thanks so much for all of your help. I'll keep looking to see if I can figure out the sort_*