coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: qemart on March 19, 2004, 12:18:43 PM

Title: [Solved]: Help - Generate Key Words from Filename?
Post by: qemart on March 19, 2004, 12:18:43 PM
(1000 apologies if this is answered somewhere but I searched and read until my eyes were bugging out of my head :shock: and found nada...)

I have a large directory structure of images and each image filename contains relevant info for indexing (eg. 1982tor02.jpg = Year 1982 ::  Toronto :: Image#02).  I am wondering how I would go about adding the 20000 images to my coppermine install in such a way as to allow for a search on "Toronto" to return a result containing all images with "tor" in the filename.

Any and all help is more than appreciated.
Title: [Solved]: Help - Generate Key Words from Filename?
Post by: Joachim Müller on March 19, 2004, 04:13:04 PM
There's no mod available for this yet, and I wouldn't do such a mod to modify the search this way. Instead, I'd write a small script that runs through all entries in your database once (table cpg11d_pictures) and let it scan for "tor". If "tor" is found in the filename, add "Toronto" to the keywords. If you have an advanced naming scheme, then apply it this way.

If you have album names or file/folder structure set up in a way that makes sense, you could as well do something likeUPDATE `cpg11d_pictures` SET `keywords` = 'Toronto 1982' WHERE `filepath ` = 'my_pics/toronto/1982/';

GauGau

P.S. Please don't ask me to create such a mod for you, since no-one else could use it, and it'd take me some time to do this mod. If you need it, you'll probably have to write it yourself.
Title: Thank You.
Post by: qemart on March 21, 2004, 02:01:41 AM
Thanks - that worked perfectly.