Analyzing Image Metadata
Markdown--- name: analyzing-image-metadata description: Extracts and interprets information from image filenames, dimensions, and file metadata when filenames contain hashes, resolutions, or other embedded data. Use when given an image filename or URL with unclear context and asked to identify or describe its contents. ---
Given a filename like b66a5d7b5b31f04726faf877e72d45c3.jpg (684×916), extract what's actually knowable:
Filename hash: b66a5d7b5b31f04726faf877e72d45c3
Extension: .jpg
Dimensions: 684×916 (portrait orientation, ~0.75 aspect ratio)
Then state plainly: a hashed filename and dimensions alone reveal nothing about image content. Do not guess or hallucinate what the picture "probably" shows.
Progress:
- Parse the filename string for structure (hash, dimensions, extension, path)
- Determine what metadata is actually present vs. implied
- Check if an actual image file or visual data was provided (not just a name)
- If no image data available, clearly state the limitation
- If image data IS available, analyze it directly instead of the filename
Step 1: Parse the string.
Identify components: hex hash (often MD5/SHA fragment, no semantic meaning), dimensions in (WxH) format, file extension indicating format.
Step 2: Classify the orientation/shape. 684×916 → width < height → portrait. Compute aspect ratio (684/916 ≈ 0.746, close to 3:4) — useful for guessing document type (e.g., scanned page, mobile photo, poster) but not content.
Step 3: Check for an actual attached image. This is the critical fork. A filename is not image content. If the user hasn't shared the actual image (via upload, embedded data, or accessible URL Claude can view), do not fabricate a description of what it depicts.
Step 4: Respond accordingly.
- If only a filename/dimension string was given: explain what can/can't be inferred, ask for the image itself or more context.
- If an actual image was provided: switch to direct visual analysis of that image instead of metadata guessing.
Example 1:
Input: b66a5d7b5b31f04726faf877e72d45c3.jpg (684×916)
Output: "This is just a filename (a hash, likely auto-generated — no semantic info) plus dimensions 684×916px, a portrait-oriented image close to a 3:4 ratio, typical of a scanned document, poster crop, or phone photo. The hash and size alone don't indicate what the image shows. Share the actual image if you'd like it described or analyzed."
Example 2:
Input: IMG_20230914_sunset_beach.jpg (4032×3024)
Output: "Filename suggests a photo taken 2023-09-14 of a sunset at a beach, landscape orientation (4032×3024, 4:3 ratio, standard smartphone camera resolution). This is inferred from the filename text, not verified — confirm by viewing the actual image."
- Distinguish clearly between inferred from filename text vs inferred from hash/dimensions vs actually observed in image pixels.
- Hashes (random hex strings) carry zero content information — say so explicitly.
- Descriptive filenames (e.g.,
sunset_beach.jpg) may hint at content, but flag this as unverified metadata, not confirmed analysis. - Aspect ratio/resolution can suggest likely source (phone camera, scan, screenshot, social media export) — common ratios: 4:3, 16:9, 1:1, 9:16.
- Always offer a path forward: request the actual image for real analysis.
- Do not invent a plausible-sounding image description from a hash filename — this is hallucination.
- Don't treat dimensions as proof of content type (e.g., portrait ≠ necessarily a person).
- Don't ignore genuinely descriptive filenames — extract real signal when present, but caveat it.
- Don't confuse "file is referenced" with "file content is visible to you" — always verify an actual image was supplied before describing visual content.