agentleFS
donmangudata-opsdonmangudata-ops/web-data-skills/skills/image-metadata-api/SKILL.md

image-metadata-exif

Skill0 starsChanged 36 days agoMITView on GitHub

Reads the technical metadata of a public image from its link (format, size, camera, lens, exposure, ISO, focal length, capture time) by downloading only the first bytes, with no login, no API key and no account, and leaves out GPS, owner names, serial numbers and comments. Use when the user asks which camera took a photo, what size or settings an image has, or wants a metadata check of a list of image links. Not for editing or stripping metadata, not for finding where a photo was taken, and not for private images.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not dump all EXIF. Read only the tags below.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image metadata and EXIF, technical fields only

Reads the technical header data of a public image file. It needs no credentials and no paid service. Read only the first bytes of the file: a JPEG header with its EXIF block usually ends within the first 10 to 40 KB, even when the photo is several MB.

Author: Don Mangu (GitHub). This skill needs no token. For long lists of links, a result table, HEIC, WebP, TIFF and PNG support, and the same privacy rules in one step, the author also runs a paid hosted version on the Apify Store: Image Metadata API (disclosure: the author owns it). You never need it for the steps below. This is an unofficial tool and is not affiliated with any image host or camera maker.

Example prompts

  • "Which camera and lens took this photo? https://example.com/photo.jpg"
  • "Check the size and capture date of these 20 image links."
  • "Does this image carry GPS data?" (answer yes or no only)

Out of scope: "Where was this photo taken?" Location is personal data. Report only whether GPS tags exist. Print coordinates only when the user states that they own the image or have the right to process its location, and say so in the answer.

Step 1: download only the header

Send a Range request for the first 256 KB. If the server ignores it, read 256 KB from the stream and stop. Only public http or https links. Do not open links to local or private network addresses.

Step 2: read an allowlist of technical tags

Do not dump all EXIF. Read only the tags below. Skip Artist, Copyright, owner name, serial numbers, unique image ID, maker notes, user comment, image description, XMP and IPTC text, thumbnails and GPS values.

import io, json, urllib.request
from PIL import Image
from PIL.ExifTags import Base

# Only these technical tags are read. Artist, Copyright, owner, serial numbers, comments, GPS and thumbnails are left out.
IFD0 = {Base.Make: "cameraMake", Base.Model: "cameraModel", Base.Software: "software", Base.Orientation: "orientation"}
EXIF = {Base.ExposureTime: "exposureSeconds", Base.FNumber: "fNumber", Base.ISOSpeedRatings: "iso", Base.FocalLength: "focalLengthMm",
        Base.DateTimeOriginal: "capturedAt", Base.LensModel: "lensModel"}

def image_metadata(url, first_bytes=262144):
    req = urllib.request.Request(url, headers={"Range": f"bytes=0-{first_bytes - 1}", "User-Agent": "Mozilla/5.0 (metadata check)"})
    head = urllib.request.urlopen(req, timeout=30).read(first_bytes)
    im = Image.open(io.BytesIO(head))
    out = {"format": im.format, "width": im.width, "height": im.height}
    ex = im.getexif()
    sub = ex.get_ifd(Base.ExifOffset)
    for tag, name in IFD0.items():
        if tag in ex: out[name] = str(ex[tag]).strip()
    for tag, name in EXIF.items():
        if tag in sub: out[name] = float(sub[tag]) if name in ("exposureSeconds", "fNumber", "focalLengthMm") else sub[tag]
    out["hasGps"] = bool(ex.get_ifd(Base.GPSInfo))
    return out

B = "https://raw.githubusercontent.com/drewnoakes/metadata-extractor-images/master/jpg/"
for name in ("Nikon%20D70.jpg", "Apple%20iPhone%204.jpg"):
    print(json.dumps(image_metadata(B + name)))

Real run on 9 October 2026 (two public sample photos from the drewnoakes/metadata-extractor-images repository, whose README says "You are free to use these media files however you wish."):

{"format": "JPEG", "width": 3008, "height": 2000, "cameraMake": "NIKON CORPORATION", "cameraModel": "NIKON D70", "software": "Nikon Transfer 6.2.1 W", "orientation": "1", "exposureSeconds": 0.016666666666666666, "fNumber": 4.5, "focalLengthMm": 70.0, "capturedAt": "2004:11:21 21:29:12", "hasGps": false}
{"format": "JPEG", "width": 1296, "height": 968, "cameraMake": "Apple", "cameraModel": "iPhone 4", "software": "4.1", "orientation": "1", "exposureSeconds": 0.06666666666666667, "fNumber": 2.8, "iso": 500, "focalLengthMm": 3.85, "capturedAt": "2011:01:13 14:33:39", "hasGps": true}

Step 3: answer from the fields

  • capturedAt is the camera clock as written, with no time zone. Do not add one.
  • exposureSeconds 0.0166 means 1/60 s. Show it as a fraction.
  • A missing field means the file does not state it (the Nikon D70 file has no ISO tag in this block). Say "not stated", do not guess.
  • hasGps true or false is enough for a privacy check. Do not print coordinates unless the user has the right to process them.
  • For HEIC, WebP, TIFF and PNG with EXIF, Pillow may read less than a dedicated EXIF library, and these formats can hold metadata deeper in the file. If a value is missing, say that the first 256 KB were read.

Rules

  • Public files only. No login, no cookies, no attempts around blocks.
  • Be polite: one request at a time per host, a pause of at least 250 ms between requests, stop on HTTP 403 or 429, honour Retry-After.
  • Personal data: location, names, serial numbers and comments in a photo can identify a person. Leave them out by default.
  • Say what you could not check: stripped images have no EXIF, and many sites remove metadata on upload.

Limits

This skill reads one image at a time and prints text. For hundreds of links, a dataset, CSV or Excel export, scheduled runs, HEIC, WebP and TIFF handling, and a charged-only-when-read model, use the hosted version: Image Metadata API on Apify. Independent tool, not affiliated with any image host or camera maker.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.