EXIF data included in MySQL Database - but Search won't work...

Hello, I'm new in PHP and Zenphoto and have a little problem. When I import pictures into Zenphoto EXIF data will be read and written into SQL. Search is configured to search also for EXIF data. When I now search e.g. for Filenames, part of filenames search will work and shows results. When I do the same and search for EXIF Data, e.g. exposure time or so - search will show no results. I think I missed a bit somewhere...

Can someone help?

Many thanks,
Roland

Comments

  • acrylian Administrator, Developer
    You have to enable the field for searching. Please do a forum search, this has been covered several times.
  • GiehRo Member
    Hi, what does you mean with "enable the field for searching"? I'm using Theme "Zenpage - Malte Müller", Search field is enabled in Theme-Settings, Search field is shown on Gallerie-Index page and I can search for File-Names already - but search for any kind of EXIF data won't work.
  • acrylian Administrator, Developer
    Look at Options > Search > Fields list
  • GiehRo Member
    This is already enabled too and I'm able to check/uncheck the different search-fields. Pull my hairs out. Have checked MySQL too, all EXIF Data is included in database. Strange.
  • Suggest you check the following:

    Is the data really in the field you selected in the database?
    Is your "treat spaces" option causing the search to fail?

    Also look at the `$_zp_exifvars` in functions.php to be sure you know the correspondence between the selection values and the DB field names.
  • GiehRo Member
    Thx, but it has changed nothing. Have checked "treat spaces" option - was disabled. Have enabled, tested - disabled, tested - same issue.

    $_zp_exifvars also checked, looks okay, below the first two EXIF-Lines:

    'EXIFMake' => array('IFD0', 'Make', gettext('Camera Maker'), true, 52),
    'EXIFModel' => array('IFD0', 'Model', gettext('Camera Model'), true, 52),

    Camera is a Nikon D-Series.

    When I search for 'D3s', search will nothing display, zero result.
    When I search for 'D', results are aval.

    You can give it a try under http://test.gotdns.com/zenphoto

    EXIF's will be shown when you click on "Bild Info" - give it a try, too. This means, EXIF Data are properly written into SQL and 'exifvars' are also okay. Do not fully understand how this works but I think "Search" and "Show EXIF" will use the same field & database mapping.

    Thx a lot!!
  • I really do not have a clue why this would not be working for you. You can try my site http://testalbum.sbillard.org/page/search/ and search for D200 (I can't afford a D3!) which does work.

    My only other suggestion is to try the nightly build--that is what I am running.
  • GiehRo Member
    Tested it on your site.

    D200 as a search criteria works fine - but have you tried to search for Aperture/Fnumber/EXIFFNumber ( string 'f/5.6' or only '5.6' or only 'f/' - all these strings should work from my point of view )?

    You have some pictures, taken with FNumber f/5.6 and Search result is Zero.

    ISO does also not work. When I search for '100' Search brings no result. When I search for '200' search will have results - but from picture date year 2007.

    This means - it does not work on your site - from my point of view. Sorry :-(

    Thx!
  • I did not have those fields selected for searching. You can now try for "f/5.6" and you will get results. I did not bother to test this earlier as I could see that the camera model did not work on your site but did on mine.

    [aside] you can always tell what fields are enabled by clicking on the little list icon between the field and the search icon. That way you will know if data from those fields is supposed to be found and not be embarased by saying the site does not work when it is doing exactly what it is supposed to do.
  • frankm Member
    hi

    could it be related to the same problem i had couple days ago (i.e. EXIFDescription field being not searched). in the class-search.php file the EXIF field names are changed to lowercase preventing the search to be correctly done. here is what i did to fix the problem:

    in the class-search.php file, in the searchFieldsAndTags function, i have replaced `$columns[] = strtolower($row['Field']);` by `$columns[] = $row['Field'];` on line 729. now the search engine works for EXIFDescription (or image title). maybe the same modification will get the other EXIF field to be search correctly.

    cheers,
    frank.
  • Good point. That is fixed in the nightly builds. (Thus the recommendation to give it a try.)
  • GiehRo Member
    Realy good point. Have no access to my test enviroment at the moment. Will test this today evening and keep you in the loop.

    Thx
    Roland
  • GiehRo Member
    Hi,

    have edited class-search.php and removed 'strtolower', in my File-Version on Line 679.

    Before: $columns[] = strtolower($row['Field']);
    After: $columns[] = ($row['Field']);

    Search is working properly now.

    Many thanks!!

    Roland
Sign In or Register to comment.