# What data counts as “photos” or “movies”

When looking up how much data is left on my tiny MacBooks SSD (under "about this mac"/"storage" 1.74 GB are marked as photos, and 429.9 MB as movies, which is odd, considering that I intentionally have deleted the photo library and the iMovie library.

This leaves me with two possible conclusions: either there are some "secret" photo and movie libraries containing above 2 GB of data, or this photo/movie data includes all image and movie files (ie. PNG, JPEG, MPEG, MOV, and similar) which are in use other places on my computer.

My question is, therefore, does this photo and movie data only include files saved in specific folders/libraries at specific locations associated with build in movie/imaging programs such as iMovie, photobooth or similar, or does it include a vast number of files with different purposes at different locations around the filesystem?

Spotlight is the system that classifies files, so if you use the command line tool in terminal.app to list the spotlight information of a file you can see how the classification is performed:

1. Open terminal
2. Type mdls and then drag any file from your desktop (or anywhere in finder) to the window and drop the icon.
3. Press return

The fields to focus on are kMDItemContentType and kMDItemContentTypeTree and a bit further down the list is kMDItemKind ;

kMDItemContentType             = "public.png"
kMDItemContentTypeTree         = (
"public.png",
"public.item",
"public.png",
kMDItemKind                    = "Portable Network Graphics image"


In my example I used a screen shot png file - which is one of many image formats that will then be counted against the total. Under kind information, you can also see the logical (size of the bits) and physical size (how much space the file takes up on the drive with overhead for block sizes and accounting) which would get summed up for each "category"

So - to find out what might be categorized as an image - type this command out (or paste it if you trust me/it/whomever edits this last):

mdfind "kMDItemKind = '*image*'" | head -3


The pipe symbol | takes all the lines of text that mdfind produces and shows you the first three lines of text. Instead of piping to head -3 you could also pipe to more to page through the list one screen at a time. Press spacebar to move, q to quit and h for help in more.

To count all the files with the string image in the kMDItemKind field:

mdfind "kMDItemKind = '*image*'" | wc -l


For context, my two smaller Mac have between 85k image files and 110k image files. Note, on newer OS - some of the images will be marked "purgeable" so you might over count at the command line but you should have a better feeling of what images exist and if you need to uninstall apps or they are just part of the operating system to have images to show you for the controls in Safari, the default desktop backgrounds, etc...