Metascope is a simple, focused Flask web application that lets you upload two or more image files, extracts metadata from each using the command-line exiftool utility, and returns a JSON response showing each file's metadata and which metadata fields differ between files.
- Upload two or more images and compare their metadata side-by-side.
- Uses
exiftoolto extract robust, detailed metadata for many image formats. - Returns a JSON response containing per-file metadata, saved file paths, and a per-file list of metadata fields that differ from the others.
- Python 3.8 or newer
- Flask
- exiftool (installed and available in PATH)
Optional (developer helper): Pillow (PIL) if you run legacy helper scripts.
- Create and activate a virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install the Python dependency
pip install Flask-
Ensure
exiftoolis installed and on your PATH (download from https://exiftool.org/ if needed). -
Start the app
python app.pyOpen http://127.0.0.1:5000/ in your browser and use the upload form to select two or more images.
Endpoint: POST /upload_and_compare
- Form field:
files(multipart/form-data) — supply two or more image files.
Successful response (example)
{
"metadata": [
{"SourceFile": "uploads/img1.jpg", "Model": "Canon ...", "SHA256": "...", "GPSLatitude": 12.34},
{"SourceFile": "uploads/img2.jpg", "Model": "Canon ...", "SHA256": "...", "GPSLatitude": 56.78}
],
"paths": ["uploads/img1.jpg", "uploads/img2.jpg"],
"diff_indices": {"0": ["GPSLatitude"], "1": ["GPSLatitude"]}
}This response includes the extracted metadata array, the server-side saved paths, and diff_indices which maps file indexes to lists of metadata fields that differ for that file.
Example curl (POSIX):
curl -F "files=@img1.jpg" -F "files=@img2.jpg" http://127.0.0.1:5000/upload_and_compareapp.py— Flask application and upload/compare endpointtemplates/index.html— basic upload UIstatic/— static assets (CSS/JS if any)uploads/— runtime upload directory (where uploaded images are saved)
This repository provides the minimal server and frontend to extract EXIF/metadata with exiftool and compare results across multiple files. It is intended as a small utility or starting point for building richer metadata analysis tools.
No license file is included in this repository. Add a LICENSE if you want to make reuse terms explicit.
If you'd like this file saved as README.md (so GitHub shows it automatically on the repo page), tell me and I will rename it for you.