Convert EXIF field to TAG?

Is there an easy (or even difficult) way to convert EXIF data to tags? I'm thinking it would be nice to be able to search the images by camera or lens used. If they were tags then the search would be easy, but manually adding those tags to every image seems a lot of work when the data is in the EXIF info and Zenphoto has already read that.

If nobody has done it I might give it a try myself. It's easy in principle, but that doesn't mean it will be easy in practice (especially for someone who isn't very familiar with the overall architecture of the software).

Comments

  • Well, I know you can go into Options -> Search and add stuff like Camera Make and Model to the search. I was able to search for the different cameras then. You can click on the search parameters button and only select those items to search in so you not searching the image descriptions and such at the same time.
  • Mark - Thanks! I wasn't aware of that and it does indeed work and gets me about 1/2 way to where I'd ideally like to be. I can search on camera or lens - provide I know the names used

    If those were tag fields though I wouldn't have to know the exact format of the camera name and/or lens name to search on. Plus when I saw an image I could ask for all the others shot by the same camera or by the same lens with a single click (on the tag). That would be more desirable and easier to do. But a least you gave me an alternate method if all else fails!

    It looks like clicking on the tag actually does do a search on the text of the tag, so the search method is already there. I guess I just need to get the value of the EXIF tags I'm interested in and make them into search queries. If I could make them into tags, Zenphoto would automatically do that for me. I have the EXIF values I just need to figure out how to tag the image with them. It's probably in the documentation somewhere, but I haven't found it yet.
  • acrylian Administrator, Developer
    You can of course do this but you would need to code it. You could do that via the object base of Zenphoto for example: http://www.zenphoto.org/news/zenphotos-object-model-framework

    Info about the classes here: http://www.zenphoto.org/documentation/li_classes.html

    But be aware this might be a bit advanced coding.
  • Thanks for the tips. At least that gives me some clues where to look to do it right if I get enough experience to do it. Right now it looks a bit advanced for my level of ability!

    I did come up with something that almost seems to work OK. It doesn't convert EXIF info to tags but it does put clickable links on the page for the EXIF data

    `
    echo '';
    echo getImageData('EXIFModel');
    echo '

    ';

    echo '';
    echo getImageData('EXIFLensInfo');
    echo '

    ';
    `
    It works fine on the initial click to show all the images with that tag, and clicking on an image thumbnail gets to the image OK. However sometimes (but certainly not always) the "search" link on the image page you get to via this route doesn't work. I think it may be due to certain characters (like the + sign maybe?) that can crop up in a few LensInfo links. I'll have to look at that in more detail.
  • Announcing a new plugin--tagFromMetadata.

    This plugin allows a site to automatically create and assign tags based on image metadata. Plugin options allow the site administrator to specify which image metadata fields to be processed. When metadata is imported from an image the plugin will look for data in the specified fields. If found, the image will be tagged with the value of these selected fields.

    E.g. The when the EXIFModel field is selected the information the camera places in this field will become a tag. (Typically this is the camera name--NIKON D300 for instance.) Thus it will be possible to tag search for images taken by a NIKON D300.

    NOTE: Only metadata fields that are enabled for processing may be chosen for tag candidates. It is not necessary to have chosen to display the field in metadata lists, though, so it is possible to search for fields that do not present in the Image Info display.

    Available on the ZenPhoto20 gitHub repository.
  • I'm new to Zenphoto so I don't 100% understand the plugin/extension process of the differences between v1.x.x and v2.x.x, but I gather that "tagFromMetadata" is an extension (which will be?) built into the core of Zenphoto 2.0.x, not something that I could add a plugin to ZenPhoto 1.4.7 (which is what I'm running).

    I could manually make the changes noted on gitHub, but I don't know if the code for ZenPhoto 2.0 is compatible with that for 1.4.7

    I did try a few experiments but had issues with "exifTranslations.php" which doesn't seem to be in v1.4.7 and calls to "exiftranslate()".
  • "Zenphoto20" is a fork of the original Zenphoto and is not supported on this forum. So the plugin mentioned above just adds confusion since it is for another piece of software/project that has taken another direction.
  • Thanks

    That's what if figured but I wasn't sure. The tagFromMetadata.php code appears to work (i.e. the admin interface does what it should) but it calls functions that aren't found and so generates errors.

    I suppose it might form the basis for the v1.4.x version with a little tweaking from someone who knows what they are doing (i.e. not me).

    The workaround code I posted above seems to do OK, though there does seem to be a glitch in the search function. If you search on "EF-S17-85mm f/4-5.6 IS USM" and you have images with that in one of the EXIF tags you've enabled search on, it brings up a number of images and then if you click on one of the images, then on the image page click on search again, it doesn't go back to the search results. It goes to a non-existent page:

    /zenphoto/page/search/%22EF-S17-85mm+f%2F4-5.6+IS+USM%22

    It appears to be something to do with the way the forward slash is encoded but I haven't quite worked out exactly what the problem is. If you truncate the search to just "EF-S17-85mm" than all works fine. Problem is if you have a 50mm f/1.4 and a 50mm f/1.8, you can't just truncate the name after the "mm" if you want to differentiate between the two lenses. Perhaps I should report this as a bug?
  • acrylian Administrator, Developer
    A ticket is always a good idea so it is not forgotten.
Sign In or Register to comment.