Photo metadata: five checks before a community upload
Published 2026-11-15 · BasicSec editorial team · Reproducible teaching exercise
1. Separate the file review from the picture review
Two PNGs can look identical on screen even when one contains an author’s name. Before posting a community photo, check both the details visible in the picture and the information saved inside the file.
Check who can handle the original in the small-group account and backup guide. For practice, use the two generated PNGs below. Both contain invented data, so you can try the inspection without opening a private photo.
2. Compare two files with the same image data
The companion metadata-fixture/inspect_demo.py uses Python's standard library to generate two four-by-four RGB PNG files. Both use the same compressed image data. One also contains two deliberately fictional text entries:
| Field | Invented value |
|---|---|
| Author | Example workshop |
| Description | Synthetic fixture, not a camera photo |
The W3C PNG specification describes text chunks including tEXt, iTXt and zTXt. This demonstration inspects only its own tEXt entries. A PNG exercise is not an EXIF, JPEG or phone-camera inspection procedure.
Run the companion script from its saved location with Python 3. It writes synthetic-tagged.png and synthetic-without-text.png beside itself, then prints a JSON result. It does not upload either file. Use a separate exercise directory; do not replace the filenames with private photographs.
The inspector found both invented text entries in the tagged PNG and none in the other file. The compressed image data matched. Inspecting the tagged PNG left its digest unchanged, and a separate decoder confirmed that each image was four pixels wide and four pixels high.
3. Record what the check covered
| Review question | What to write down |
|---|---|
| Which file was inspected? | Its filename and an identifier such as a digest; keep the original separately |
| Which tool and scope? | Tool/version and metadata families it actually examines |
| What was observed? | Fields found, fields intentionally retained, and unresolved items |
| What can still identify someone? | Visible faces, badges, screens, landmarks, captions and filenames need their own review |
| Is sharing authorized? | Record the decision through the group's normal process; a metadata check supplies no permission |
4. Keep the limits with the result
An empty text-field report still leaves several questions open. This script checks PNG tEXt entries only. It skips EXIF, XMP, iTXt, zTXt, video tracks and platform previews. Look at the picture itself, too: a badge or street sign can identify someone even in a file with no metadata.
For a real upload, use a trusted local tool appropriate to the actual file format and inspect a separate sharing copy. If the tool's coverage is unclear, keep that uncertainty in the record instead of labelling the file “clean.” A later platform check would also need to distinguish the original upload from any downloaded derivative; none was performed here.
Next, use the backup restore-test worksheet to connect the sharing decision with authorized access and preservation of the original.
5. Repeat the small exercise
Download the readable Python demonstration, the tagged PNG, the PNG without text entries and the recorded demonstration result. Save the code as inspect_demo.py in a separate exercise directory and read it before running python3 inspect_demo.py. It accepts no private-photo arguments. The published version refuses to replace a file whose bytes differ from the generated fixture. This is a limited inspection exercise, not a sanitization tool.