Author Topic: Searching For Photos Based On Tags  (Read 2943 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2304
  • Country: us
Searching For Photos Based On Tags
« on: January 08, 2025, 02:16:40 am »
I had an odd idea, that after some brief research, seems more popular than I thought because various types of software exists (and it can probably be done in Excel).

My thought is to tag several images (JPGs) and create a way to search for them based on a criteria. Unfortunately I think it will be too time consuming but wanted to ask if such a program exists that anyone is aware of.

The idea I had was for a collection of family photos comprised of about 2k pictures. I thought to create a program where I could check boxes that would filter the pictures. The check boxes could be customized so they could be a check box for: mom, dad, brother, sister, aunt, uncle, car, vacation, etc...

As I check each box, it narrows down the pictures. Say I wanted every picture with mom and car (maybe I have several of mom standing by a car). Then it will give me only pictures with mom and a car whereas I may have a picture of date standing by a car and those would be ignored; unless I checked only 'car'.

I think the part of creating filtering software would be easy, however, tagging each photo individually would be extremely time consuming. Each photo file name would need to go into a database, and associated with the tags. Each photo would need to have a tag for each check box in the software. So I'd have to view a picture, and somehow enter into the database filename1.jpg has 'mom', and 'car', filename2.jpg has 'dad' and 'mom', etc...

Just curious if anything like that exists, but, as mentioned, I think it would be a time consuming process that's not worth it; unless I wanted to take several hours creating the tags.
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #1 on: January 08, 2025, 04:01:16 am »
I actually started to write such a program myself (Windows GUI), that would allow photos to be tagged and retrieved in a database. Ended up with just a picture viewer. I'll have to go back and take another look at it.

It's definitely a non-trivial undertaking, but one that would be doable and quite useful.

Hard to imagine that there's not already some software out there that does just that, but I don't know of any.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2304
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #2 on: January 08, 2025, 04:38:09 am »
Wow, so someone else had a similar idea.

As mentioned, I honestly doubt associating every picture with tags to be filtered would be easy. The idea I had (which isn't any easier) is:

The (as you suggested and I visualized) GUI would allow someone to create their own criteria list because everyone would have different needs. Maybe one person wants to use it for family photos (mom, dad, etc...) whereas someone else wants it to organize photography (trees, mountains, etc...).

To simplify it, let's say the criteria is two (mom and dad), then the program displays the first picture and asks: mom y/n. The person selects 'Y' for yes stating the picture contains 'mom' (or 'N' for no) and then displays the second picture asking the same. After it goes through all (say) 2k pictures, then it asks: dad y/n and starts showing all the pictures again.

This would repeat for however many criteria options the person has. If the person wanted 20 options, then they'd have to go through every picture answering Y or N 20 times. If it were 2k pictures, it would be 40k (2k times 20), so most likely few will do this.

The other option would be to display all the pictures in thumbnails, select criteria "mom", and click on every picture you want associated with "mom". Then uncheck "mom" and check "dad" and click on every picture associated with "dad". This would repeat for (as the example above) the 20 options.

I imagine to make it less blinding with the thumbnail options, one could move maybe 25 pictures into a directory and do 25 at a time, then combine them into the one directory (or directories) again.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13353
  • Country: ch
Re: Searching For Photos Based On Tags
« Reply #3 on: January 08, 2025, 08:41:11 am »
I loved the hierarchical tagging in Apple’s long-defunct pro photo management program, Aperture. You could make entire hierarchies of tags, and searches would correctly include the photos with subordinate tags.

For example, you could have:
-People
- - Friends
- - - …
- - Family
- - - Parents
- - - - Mom
- - - - Dad
- - - Siblings
- - - - Bro
- - - - Sis


(Actually there is a separate face tagging function too.)

So if you did a search for the keywords “family” and “Argentina” (assuming you’d made a similar hierarchy for one’s travels), then it would also find photos that didn’t expressly have those keywords but does have subordinate ones, for example a photo tagged “Mom” and “Buenos Aires”.

I still have my DSLR photo library managed in Aperture running on an old Mac Pro. Apple never provided a truly good migration path from Aperture to anything else. :/
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: gb
Re: Searching For Photos Based On Tags
« Reply #4 on: January 08, 2025, 11:08:09 am »
BeFS on Haiku/OS is a "relational filesystem" and can store "tags" in metadata.
I think this is the perfect use for its unique feature!  :o
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7433
  • Country: fi
    • My home page and email address
Re: Searching For Photos Based On Tags
« Reply #5 on: January 08, 2025, 11:42:38 am »
I implemented this as web pages back in 1999 with the backend in PHP, for an interactive exhibition at Kiasma museum in Helsinki, Finland.

Nowadays you could do that easily as a static web page, with the images in a subdirectory, plus a simple Javascript file describing the images, basically along the lines of
Code: [Select]
const images = [
  { thumbnail: "IMG_20250801_000000-small.jpg", thumbwidth:400, thumbheight:300,
    original: "IMG_20250801_000000.jpeg", originalwidth:3264, originalheight:1840,
    title: "Mom with her car in 1995",
    keywords: [ "mom", "mother", "car" ],
    description: "Long text describing the image." },
// above structure repeated for each image
];
I'd generate the thumbnail versions automatically using command-line tools like ImageMagick, and automate the pixel size fields leaving title and keywords empty, and populate those by hand.  Note that the file containing the images array object does not need anything except as shown.

This way, you could open the "gallery" on any computer with a browser, even on a cell phone; either locally or from a secured web site.  (The Javascript says the same regardless of whether you use it locally, or from a web site.)

The coding part is easy; the hard part is making the user interface nice, easy, and intuitive enough for others to use it, making it worth implementing.

The keyword search and image title search (same text-based search, with +required and -disallowed prefixes and double-quoted exact search terms, with checkboxes to limit the search to keywords, to image titles, and/or to long description.)

It is possible to interface to Excel and other spreadsheet programs using CSV format, although parsing it in JavaScript is a bit annoying.  More useful would be a feature that allows one to add new (local) images to the data array with an easy interface –– but when saving, the user needs to select the correct file and name to save it over, because it uses the browser save/download feature; it cannot be made easier than that.  (The user needs to create the thumbnail versions themselves, and move the image file to the images directory, and know the names of the files when adding the metadata; I do not believe it is feasible for the browser to scan the directory contents.)

As a web service, if you have a web server or web hotel, all this is trivial, except for securing part (which itself is also standard stuff for secure web services).
 

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 483
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #6 on: January 08, 2025, 07:17:52 pm »
There's lots of tools out there that do this... many now also will do the tagging for you based on object and facial recognition ML models, and are getting pretty good at it. Most of them tend to be aimed at photographers and creative agencies. The search term you want is "Digital Asset Management (DAM)" The commercial ones can get quite fancy and expensive, but there are some open source alternatives too.
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #7 on: January 09, 2025, 09:18:23 am »
Wow, so someone else had a similar idea.

As mentioned, I honestly doubt associating every picture with tags to be filtered would be easy. The idea I had (which isn't any easier) is:

The (as you suggested and I visualized) GUI would allow someone to create their own criteria list because everyone would have different needs. Maybe one person wants to use it for family photos (mom, dad, etc...) whereas someone else wants it to organize photography (trees, mountains, etc...).

Just for giggles I went ahead and mocked up part of a program that might do what you described:





The first dialog builds the list of tags, just a simple list of text strings that can be used for tagging pictures.
The second one tags pictures with selected tags.

Rather than have separate lists for different people using this, I assumed just one list where everyone could just add whatever tags they want to the pool, assuming no privacy issues.

This would all go into a database containing the filename of the picture and the tags selected for that picture. It would be pretty simple to go through a folder and pull out all pictures that had certain tags set. (That would be another dialog which I haven't mocked up.)

All this is doable, but there's a major problem that I don't know how to solve:
Say you've gone through all your pics, tagged them and created this database. Fine and dandy.
But then you decide you want to rename some of the pictures. And move some pictures to a different folder, or a different drive altogether. Now the database you've created is out of sync with the computer's file system. And that's a major problem.

So I probably won't be trying to actually implement this anytime soon. But I was curious to see if this was anywhere close to what you had in mind.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7433
  • Country: fi
    • My home page and email address
Re: Searching For Photos Based On Tags
« Reply #8 on: January 09, 2025, 10:18:16 am »
Note that all JPEG file formats (SPIFF, JFIF, EXIF) support custom or description chunks you can store UTF-8 encoded keywords/description in.  You will want to copy the information to an index for more effective searching, though.  One commonly used approach is to keep such an index file –– perhaps an SQLite database, perhaps something else –– in the image archive directory, so that if the directory modification timestamp is newer than the index file modification timestamp, the index is stale and needs to be rebuilt.
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #9 on: January 09, 2025, 10:34:50 am »
Note that all JPEG file formats (SPIFF, JFIF, EXIF) support custom or description chunks you can store UTF-8 encoded keywords/description in.  You will want to copy the information to an index for more effective searching, though.  One commonly used approach is to keep such an index file –– perhaps an SQLite database, perhaps something else –– in the image archive directory, so that if the directory modification timestamp is newer than the index file modification timestamp, the index is stale and needs to be rebuilt.

I wouldn't want any picture-indexing program to modify any of the picture files. Those should be off-limits, read-only.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7433
  • Country: fi
    • My home page and email address
Re: Searching For Photos Based On Tags
« Reply #10 on: January 09, 2025, 12:24:21 pm »
Note that all JPEG file formats (SPIFF, JFIF, EXIF) support custom or description chunks you can store UTF-8 encoded keywords/description in.  You will want to copy the information to an index for more effective searching, though.  One commonly used approach is to keep such an index file –– perhaps an SQLite database, perhaps something else –– in the image archive directory, so that if the directory modification timestamp is newer than the index file modification timestamp, the index is stale and needs to be rebuilt.

I wouldn't want any picture-indexing program to modify any of the picture files. Those should be off-limits, read-only.
I'm suggesting the exact opposite.

When you store an image to the collection, you add whatever description, title, and keywords associated with it.  This does not affect the image data at all, and is similar to e.g. comments stored by photo editing software.  Tools like ImageMagick do support stripping these off, and do so by default when the image is resized or edited.  Essentially, you only modify the image files when you modify the associated metadata.  The indexing application never modifies the image files, only the cached index; and it can detect whether the cache is up to date by comparing the directory modification timestamp to the index file modification timestamp.

Also, it is perfectly possible to do such editing in a way that ensures the image data remains intact.  (In fact, not doing so is one of my buttons: my data is invaluable, and tools that do not respect the integrity of my data, or do not report errors that might endanger that, are less than worthless to me; they're utter shite to me.  I despise programmers who leave "implementing error checking for later, when they have the time", because that never ever happens; and also programmers who consider checking errors that are possible but rare "useless" or "paranoid".  Paranoia is my friend, when it comes to security and data integrity.)

Note, however, that my first/primary suggestion was a separate database file.  That is not only more common, but often a better approach, exactly because the image files (possibly excepting for cached resized preview/thumbnail versions) are never ever modified.  For browser-based stuff, you can use either a plain JavaScript object declaration file (whose format is quite human-friendly), or for example JSON (which basically all browsers nowadays can parse very efficiently using the built-in JSON.parse() static method.

Modifying the image file metadata (including title, description, keywords, and possible GPS data) makes more sense only when the metadata is intrinsic part of the purpose of the images; say like recording the location, date and time, and full names of the people in an image.  For a company imaging their products, the corresponding information might be the image license, date and time, product name and version, perhaps even serial number of the product.  That way, even if the image is transferred (and in some cases modified, although as I mentioned the extra data is stripped off when using conversion or Save As... functions in photo editors), the metadata is retained.  For example, one might add such metadata before publishing, or before archiving the images on some long-term read-only media, perhaps as part of inspecting, cropping, rescaling, optimizing the photos involved.
« Last Edit: January 09, 2025, 12:28:11 pm by Nominal Animal »
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2304
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #11 on: January 09, 2025, 03:46:03 pm »
Quote
I wouldn't want any picture-indexing program to modify any of the picture files. Those should be off-limits, read-only.

I agree.

The issue of moving files, renaming, etc... I guess it could get quite complex trying to maintain it.

Years ago when newsgroups were big, a group of collectors posted pictures, thousands and thousands daily. They were pictures posted from stuff around the world, but, more common were Playboy collections. Someone created a program called Pic Check or something like that (I probably still have it somewhere).

It was maintained by a group I believe (don't quote me as I'm improvising a bit) and created a CRC for every picture maintained in an Excel sheet.

You would go on the newsgroup, download whichever category (or categories) of pictures you wanted by the 1000s (or a single picture). Now you had a directory of say 10k pictures that may or may not be legit, edited by someone, wrong names, not organized, comprised of several categories, etc...

A few maintained websites who created Excel spreadsheets (CSVs) comprised of the file names and a CRC for pictures that were legit. You'd download the CSVs, and it wasn't that many, maybe one zip file that contained ten CRC Excel files for a collection of Playboy pictures (maybe one CRC for each decade), place them in the Pic Check program, and run a scan.

The program would take the 10k files, and, providing the CRC matched, change the file names according to the CRC Excel file. It would then place them in the appropriate directories. At that point the remaining files were either junk or not associated with a CRC file that you didn't have. Maybe you desired obtaining more CRC files because it was part of another collection, or you didn't care to collect them.

The program also generated a CRC of missing files that the user didn't have but appeared in the CRC. So you could post the CRC to the newsgroup and someone may fill it for you allowing you to download them and run the whole process.

I was thinking for this idea, maybe generate CRC's for the pictures and the program could scan directories that are selected for the pictures. If a file name is different, then it could alert the user and/or ask the user if they want a list of files (pictures) changed to the new name in the directory which would then change the name in the CRC list.

Or you could have it scan a list of selected directories and it would report X files no longer exist (maybe because they were deleted or a name change)  and Y new files exist allowing the user to edit the tags so a new CRC can be generated.

As for getting around locations, I think the program could just generate a list of file names that can be double clicked. When clicked, it opens the picture in the default picture viewer such as Windows Picture Viewer (maybe a preview window in the program, but we are more focused on how to locate pictures rather than turning it into a fancy program). Generating the list can be simple as it would just scan a directory and all the sub directories along with selecting other directories.

So it could have check boxes allowing the user to select: c:\Family Photos, c:\Kid Photos, etc... and it would scan the sub directories c:\Family Photos\Mom, c:\Family Photos\Dad; and then c:\Kid Photos\Joe, c:\Kid Photos\Mary, etc...
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #12 on: January 09, 2025, 09:48:24 pm »
As for getting around locations, I think the program could just generate a list of file names that can be double clicked. When clicked, it opens the picture in the default picture viewer such as Windows Picture Viewer (maybe a preview window in the program, but we are more focused on how to locate pictures rather than turning it into a fancy program).

Displaying a picture preview is one of the more trivial aspects of such a program. The mockup I posted above has a window that shows an actual preview (scaled to fit the window) of an image file; I didn't put that image there in an image-editing program.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2304
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #13 on: January 10, 2025, 02:05:21 am »
I saw the image with the preview pane and was emphasizing that having it wasn't necessarily important, however, I didn't realize it was trivial; it's also a nice feature.

Attached is the (Freeware) program I mentioned. If you look at the dates within the ZIP, it shows 1998 and 2006, so it shows how old the program is.

I haven't played with this program in quite some time (probably since late 2000s). It can create a CRC list from a specified directory, sort, rename, etc... It's not necessarily worth investing time to learn, but more of a reference of how one person sorted pictures. Obviously this is different than tagging filenames.

 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: gb
Re: Searching For Photos Based On Tags
« Reply #14 on: January 10, 2025, 10:36:01 am »
Frankly I prefer a relational filesystem, where you can simply add a tag in metadata and query.

Makes this kind of tasks very simple, even for the GUI point of view.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4501
  • Country: gb
  • Doing electronics since the 1960s...
Re: Searching For Photos Based On Tags
« Reply #15 on: January 10, 2025, 06:19:52 pm »
ACDSEE (available in countless old versions very cheaply) does all this for you. Image selection by EXIF tags etc.

Even ACDSEE v5, which came on a CD on the cover of Personal Computer World magazine in 1995, works just great under win7-64 :) And has these features.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #16 on: January 10, 2025, 07:29:55 pm »
Frankly I prefer a relational filesystem, where you can simply add a tag in metadata and query.

What is a "relational filesystem"?
Is it something available to, say, a Windows 7 user?
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: gb
Re: Searching For Photos Based On Tags
« Reply #17 on: January 10, 2025, 08:32:30 pm »
A relational filesystem is a way to store files that combines features from classic hierarchical file systems, relational databases, and content-addressable storage systems.

Windows does not have it.
AIX does not have it.
HPUX does not have it.
Irix does not have it.
RiscOS does not have it.
NextStep does not have it.
Linux does not have it.
MacOS does not have it.
FreeBSD does not have it.
NetBSD does not have it.
OpenBSD does not have it.
MorphOS does not have it.
ArOS does not have it.
XINU does not have it.
BeOS has it.
Haiku/OS has it.

MyFS (my toy filesystem) has this feature  8)
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: gb
Re: Searching For Photos Based On Tags
« Reply #18 on: January 10, 2025, 08:34:19 pm »
Moral of the story, install Haiku on a x86 mini-pc and make it a relational filesystem + web server  :o
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: abeyer

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4549
  • Country: gb
Re: Searching For Photos Based On Tags
« Reply #19 on: January 10, 2025, 08:40:49 pm »
In theory, NTFS supports "extended attributes and alternate data streams", which you could use to do the same thing  :-//
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 483
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #20 on: January 10, 2025, 09:35:36 pm »
What is a "relational filesystem"?
Is it something available to, say, a Windows 7 user?

Not sure if that was a genuine question, or a dry jab at microsoft?  ???
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #21 on: January 10, 2025, 09:44:30 pm »
No, it's a real question: I haven't heard that term before.
Of course, I do take every opportunity to jab Micro$oft anyway ...
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7622
  • Country: va
Re: Searching For Photos Based On Tags
« Reply #22 on: January 10, 2025, 10:13:57 pm »
Wouldn't a traditional photo database app do this? For instance, Daminion allows user defined hierarchical tags, and then allows selection of super-tags and/or sub-tags as in the aforementioned 'family' super-tag with 'parents' and 'siblings' sub-tags (and sub-sub-tags). You can do searches, such as "parent AND woman" or "car OR bike", so it seems to cover everything requested in this thread.

EDIT: Seems that version of Daminion (standalone photo album) is no longer with us and they've chased the money. The version I have was free for some not excessive use (easily covered my requirements) but I never felt the need to keep it updated. Fortunately. However, I've left the description here to show that this kind of things has been around for a long time.

Another one was idimager, which was great and similar to Daminion (actually vice versa) but the author decided it needed to be done over from scratch, and that turned out as most similar restarts with good intentions do. It is now Photo Supreme and not that cheap, but also illustrates that this kind of thing isn't new.

So... what's the requirement of this thread that the typical photo management app doesn't do?
 

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 483
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #23 on: January 10, 2025, 10:34:14 pm »
No, it's a real question: I haven't heard that term before.
Of course, I do take every opportunity to jab Micro$oft anyway ...

Ha! Ok, it was just funny because of the backstory...

Microsoft had every intention of shipping a relational filesystem for windows... it was a big part of a project called windows longhorn that kind of imploded and failed. The aftermath of that is what lead to shipping vista as a "get something out the door now" mess, and the better parts of longhorn that were salvaged mostly shipped in windows 7 (but the relational filesystem wasn't one of them and was abandoned.)

So, in theory if they'd ever gotten it done, it kinda would have been a windows 7 thing. :D
 

Online Analog Kid

  • Super Contributor
  • ***
  • Posts: 1558
  • Country: us
Re: Searching For Photos Based On Tags
« Reply #24 on: January 10, 2025, 11:30:55 pm »
So in other words it doesn't even exist. (At least not in Windows-world.)

That's 10 minutes of my life I'm never getting back.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf