I have a question about IPTC metadata. Is it possible to search images that aren't in a database by their IPTC metadata (keywords) and show them and how would I go about doing this? I just need a basic idea.
I know there is the iptcparse() function for PHP.
I have already written a function to grab the image name, location, and extension for all images within a galleries folder and all subdirectories by .jpg extension.
I need to figure out how to extract the metadata without storing it in a database and how to search through it, grab the relevant images that match the search tag (their IPTC keywords should match) and how to display them. I know at the point that I have the final results (post search) i can echo an imagetag with src="$filelocation"> if i have the final results in an array.
Basically, I am not sure if I need to store all my images into a mysql database and also extract the keywords and store them in the database as well before I can actually search and display the results. Also, if you could guide me to any gallery that already is able to do this, that could help as well.
Thanks for any help regarding this issue.
If you don't have extracted those IPTC data from your images, each time someone will search, you'll have to :
If you have more than a couple image, this will be really bad for performances, I'd say.
So, in my opinion, it would be far better to :
It'll mean a bit more work for you right now : you have more code to write...
... But it also means your website will have better chances to survive when there are several images and many users doing searches.
It is not clear what in particular is giving you problems, but perhaps this will give you some ideas: