id3v2 and exif tags

Hi Folks,

Not long ago, I added some mp3s to a USB of my favorite music. I stored it, like always, <artist>/<album>/<tracks>, and I was surprised to learn that when I played that USB in the truck, the tracks were not organized like that at all! I learned that each track has a set of tags, id3v2 in this case of mp3, which the mp3 player reads and creates the implied groupings. Eye-opening! So, I spent a few days fixing my tracks. Why is this important? Because the meta-data for each track is included with the track and is preserved if I move it.

So, this raised the question about my pictures and videos. If I spend time and effort tagging pictures, I would like to know that my effort is persistent and loss of a database will not take all my hard work with it. Are Zenphoto tags being stored as "exif" tags in the image file and id3v2 tags in the audio/video file or are they being associated with the file and stored in the MySQL database?

Thanks for the help,




  • sbillard Member
    edited January 4

    Zenphoto database items are typically not propagated to the image. But all is not lost. You can apply tags to the image itself with a tool such as Adobe Bridge and Zenphoto will extract and use them. (You may need to "refresh" the metadata if you do this with existing images.)

    In general, if you can apply metadata directly to the image that is best as (as you have noted) it travels with the image. If you use Zenphoto's move/copy mechanism, database entries associated with the image travel with it.

  • Hi,

    There are lots of choices for tags, and Zenphoto is neither comprehensive nor exhaustive. I would like to selectively update the tags in the file that Zenphoto is going to use, and I don't know what those are. Zenphoto extracts these for display, so it's in the code somewhere, and all I need is a hint.

    I would love to have a utility that applies the Zenphoto database values to the image/audio/video. This way, I can tags things in Zenphoto.

    This is open source, so all I need is a hint about where Zenphoto is extracting tags for display, and a hint about where Zenphoto is updating the database. Any chance of some help?



  • acrylian Administrator, Developer
    edited January 5

    You can select the exif data fields to import on Options > Image > Metadata. Those follow the general exif definitions as much as exif is no fixed standard.

    The actual handler for reading exif data is within /zp-core/libs/exif/. Reading meta data for video/audio s done via a third party script getID3 which is part of the class-video plugin to be found in zp-data/zp-extensions/class-video/getID3/

    All these are not "single files". We strongely don't recommend to modify core files as you will get in trouble on updates otherwise.

    and a hint about where Zenphoto is updating the database.

    You have to look at the object model like the image class.

    If you need to import extra metadata fields we don't cover, you can do so by extending that via a filter via a plugin if needed and which will add more columns to the image db table.

    Zenphoto cannot update image metadata to files from the database. Simply because the graphic libs GD and Imagick can't. One can use IPTC tags which is not EXIF itself and the other one can add comments which is also not the same. You should do that with a proper EXIF tool like Photoshop, Bridge or whatever is out there before uploading.

  • Thanks very much for your advice. I I were to do this, and there is a good possibility, I would not modify anything from Zenphoto; I would inherit the classes and develop something like a Zenphoto "module".

    You have given me a huge help. I will need to read the code in the areas you suggest to understand how it works and how I can make the updates I propose without effecting much.

    I will probably create a script that looks for all tag values in the database and suggests update operations, which update would involve adding tags to the image and deleting the corresponding tag from the database.

    This should be pretty isolated. The only granularity I can imagine would be classes of media, like for example, a user might want to update images, but not videos. Probably the easiest, although primitive, solution is to create an update script that the user can modify before running.

    Now, how I do that remains a question pending future research, but which will include your advise born of experience that I don't yet have.

    Thanks for the help,


Sign In or Register to comment.