Where to save an URL?

Started by timlange3, June 04, 2025, 05:00:51 PM

Previous topic - Next topic

timlange3

I would like to encode an URL into my jpeg files so someone could get more information about the image content.  My thought was to put the URL into the metadata so my PHP scripts could display it on my web pages.

I use exif_read_data to get the metadata out of my jpeg files so I will have to store the URL where exif_read_data can get it (exif_read_data cannot read all metadata).

Just by luck I used exiftool -URL="myurl" filename.jpeg and it stored it in the file.  It went into the group "Photoshop" which is not readable by exif_read_data.  Sigh...

I used exiftool -list to get a list of all tags related to URL storage and now trying to figure out which groups they are in and if exif_read_data can read them.

Is there a source of all tag names with their group on the same line?  Would be much easier to pair group name and tag name then.

Is there a way to figure out what exif_read_data can actually read so I don't have to use trial and error for all the group / tag names related to URLs?

On the side, I see one of the properties I can display with Windows Explorer is "URL".  Would be really cool if the location I finally use for the URL could also be displayed by Windows Explorer.  I was thinking of using the "Comments" property as I know exif_read_data can read that tag.

Thanks,
Tim.


StarGeek

Quote from: timlange3 on June 04, 2025, 05:00:51 PMI use exif_read_data to get the metadata out of my jpeg files so I will have to store the URL where exif_read_data can get it (exif_read_data cannot read all metadata).

I believe the only data that the only metadata that exif_read_data can read is EXIF data. See the EXIF Tags page for all the EXIF tags.

QuoteI used exiftool -list to get a list of all tags related to URL storage and now trying to figure out which groups they are in and if exif_read_data can read them.

There really isn't a specialized location to save an URL. Most of the tags with URL in the name have very specialized purposes. Additionally, none are in the EXIF group.

QuoteIs there a source of all tag names with their group on the same line?  Would be much easier to pair group name and tag name then.

All the tags can be found split by groups on the Tags Names page. There is a PDF version which has all the tag names in a single document. It's easier to find tags by searching that, though you have to scroll up to find the actual group name.

QuoteIs there a way to figure out what exif_read_data can actually read so I don't have to use trial and error for all the group / tag names related to URLs?

As I said, I'm pretty sure that it is EXIF only. The PHP documentation specifically says
Quotereads the EXIF headers from an image file
and doesn't mention any other type of metadata. Additionally, it only mentions TIFF and JPEG, so I doubt it would be able to read EXIF data in other filetypes such as PNG files.

QuoteOn the side, I see one of the properties I can display with Windows Explorer is "URL".  Would be really cool if the location I finally use for the URL could also be displayed by Windows Explorer.  I was thinking of using the "Comments" property as I know exif_read_data can read that tag.

Just because a Windows Property exists, doesn't mean that a specific file type can be matched to that Property. See the Windows Metadata thread to see what tags Windows will read and what Properties they will be matched with.

With the parameters you've given, you're pretty limited as to what tags you can use. You can use either UserComment or XPComment and Windows will read that and show it in the "Comments" property. I'd give good odds that exif_read_data would read UserComment, but because XPComment is essentially a Windows only tag that almost no software outside of Windows reads, I don't know if exif_read_data will read it.

There are several other EXIF tags that start with XP*, which Windows will read, though they will match to other Properties in the Properties window. All of them are Windows only tags.

Another option would be ImageDescription. This is the EXIF equivalent of the XMP:Description tag, which is the standard location most Digital Asset Management (DAM) programs will save data.

For future compatibility, I would advise against using the XP* tags.

I had a discussion about placing an URL in a file in this Reddit thread though that was more about video files than about images.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype