Where is "Where from" in a macOS image stored?

1.8k Views Asked by At

Images downloaded from the web using Safari and macOS have information available from the Finder with Get Info. For example, "Where from" which can be the URL for the original image. Is that stored with the image or ?

exiftool image.jpg doesn't show the info.

The answer is in the two comments from @Gordon Davisson. Other responses were helpful also. For my purposes mdls is useful and xattr provides additional relevant information. Although I still don't quite understand where the info is stored I think it's safe to say it's not embedded in the file itself, but macOS and Windows can track the info.

3

There are 3 best solutions below

1
CJK On

To access the values for a file's Finder metadata, use the mdls command in Terminal. This will list all the metadata attributes associated with the file:

mdls /path/to/file

Whereas this will retrieve the specific attribute:

mdls -name 'kMDItemWhereFroms' /path/to/file

or

mdls -name 'kMDItemWhereFroms' /path/to/file -raw

or

mdls -name 'kMDItemWhereFroms' /path/to/file -plist -

You can read more about the command on its man page

0
Greg On

The answer is in the two comments from @Gordon Davisson. Other responses were helpful also. For my purposes mdls is useful and xattr provides additional relevant information. Although I still don't quite understand where the info is stored I think it's safe to say it's not embedded in the file itself, but macOS and Windows can track the info. PS: I'm posting this two years after the question in response to a request to do so.

0
MaduKan On

To answer @mjs's question on how to delete, this is another way I found:

# List all attributes
xattr -lvr /path/to/file

# Delete the wherefrom tag
xattr -d com.apple.metadata:kMDItemWhereFroms /path/to/file

Reference