Skip to content

How to access saved metadata from image comments

Manuel Reimer edited this page Dec 4, 2023 · 2 revisions

Background information about saved metadata

"Save Screenshot" can save some information about the screenshot as comment into the resulting images. This feature is enabled by default. The stored information is:

  • Date and time when the screenshot was created
  • Title of the website
  • Full URL of the website

The data is stored in UTF-8 format to cover all common international characters.

Access the image comments

In the following some common ways are demonstrated on how you can access the image comment. Comments are saved according to the relevant image format standards and so can probably be read and extracted using many other tools. PLEASE do not attempt to get any additional tools listed here. This is meant as a starting point. Feel free to use the tools of your choice, even if they are not listed here!

GIMP

This is what I intended this feature for, initially. GIMP is my personal image editing tool of choice and I wanted easy access to the information from there.

To access the image comment from GIMP, you have two options:

  • Click on "Image" in the menu bar and choose "Image Properties" from there
  • Use the shortcut Alt + Return

Both ways will open a "Image Properties" window. If you switch to the "Comment" tab in this window, you can access the saved metadata.

ImageMagick

ImageMagick can be used to access the saved metadata from the command line. This can be used for batch processing the saved metadata.

At the time of writing, ImageMagick did not access international PNG text chunks with the regular "comment" format string. So you have to use different command lines for JPEG and PNG:

PNG

identify -format '%[png:Comment]' FILENAME.png

JPEG

identify -format '%c' FILENAME.jpg

In both cases you get the metadata printed. You can extract the information, you need, by piping this output into tools like grep, sed, awk, ...

exiftool

With exiftool, the command line is the same for all supported image formats:

exiftool -p '$comment' FILENAME.png