exif

n8n node that reads EXIF date, camera and GPS from photos (JPEG, TIFF, PNG, WebP) with no dependencies, and can resolve the position to an address with Google Geocoding.

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.0
Author: DangerBlack

Available Nodes

Documentation generating…

Documentation

n8n-nodes-exif

An n8n community node that reads date, camera and GPS position from photo metadata and can turn the coordinates into an address with the Google Geocoding API.

  • Reads JPEG, TIFF, PNG (eXIf) and WebP (EXIF chunk).
  • No dependencies: no native modules, no exiftool, no perl. Install it and it works, on any architecture and Node version.
  • Field names follow the popular exif npm package (exif.CreateDate, gps.GPSLatitude = [deg, min, sec] …), so expressions written for a Code node using that package keep working. Ready-to-use decimal coordinates and an ISO date are added on top.

Installation

In n8n: Settings → Community Nodes → Install and enter n8n-nodes-exif.
See the community nodes installation guide.

Usage

Put the node after anything that produces a photo as binary data (HTTP Request, Telegram, S3, Read Files …).

Parameter Description
Input Binary Field Binary field with the photo (default data)
Resolve Address Look the GPS position up with Google Geocoding (needs the Google Geocoding API credential)
Options → Language Address language, e.g. it, en
Options → Keep Input Fields Add the metadata to the incoming JSON instead of replacing it
Options → Include Raw Geocoding Response Add Google's full answer under address.raw

The binary data is passed through unchanged.

Output

{
  "format": "jpeg",
  "exif": {
    "Make": "Apple",
    "Model": "iPhone 15",
    "Orientation": 6,
    "DateTimeOriginal": "2024:07:14 18:22:05",
    "CreateDate": "2024:07:14 18:22:05",
    "OffsetTimeOriginal": "+02:00"
  },
  "gps": {
    "GPSLatitudeRef": "N", "GPSLatitude": [44, 29, 30.5],
    "GPSLongitudeRef": "E", "GPSLongitude": [11, 20, 15.25],
    "GPSAltitudeRef": 0, "GPSAltitude": 54.5
  },
  "date": "2024-07-14T18:22:05+02:00",
  "location": { "latitude": 44.4918056, "longitude": 11.3375694, "altitude": 54.5 },
  "address": {
    "formatted": "Piazza Maggiore, 40124 Bologna BO, Italia",
    "street": "Piazza Maggiore",
    "postalCode": "40124",
    "locality": "Bologna",
    "province": "Città Metropolitana di Bologna",
    "region": "Emilia-Romagna",
    "country": "Italia",
    "countryCode": "IT",
    "placeId": "…"
  }
}
  • A photo without EXIF gives empty exif / gps and null date / location; it is not an error.
  • address is null when the photo has no position or Google finds nothing.
  • Cameras without a GPS fix often write 0,0: that is treated as no position.

Credential: Google Geocoding API

Create a key in the Google Cloud console with the Geocoding API enabled, restrict it to that API, and paste it into the credential. The credential test sends one geocoding request.

Limitations

  • HEIC/HEIF and camera RAW files other than TIFF-based ones are not read.
  • Only the commonly used tags are extracted (dates, camera, orientation, GPS).

Development

npm install --ignore-scripts
npm test        # parser tests on synthetic photos + node tests with a mocked Google API
npm run build
npm run lint

Test photos are generated by nodes/Exif/test/fixtures/make-fixtures.py (Pillow).

License

MIT

Discussion