Skip to main content

Get Image Metadata in n8n

What this node does

PDF4me - Get Image Metadata reads the technical properties of any image in your n8n workflow and returns them as structured data - format, width, height, DPI, bits per pixel, orientation, and EXIF camera data when present. Use the output to gate image quality checks, log asset properties to a database, route oversized images to a resize step, or validate that uploaded photos meet publishing specifications before storing them. Accepts binary data, Base64 strings, or public URLs.

Authenticating Your API Request

Every PDF4me node in n8n requires valid Credentials. Create or select credentials that hold your PDF4me API key so the node can authenticate image analysis requests securely.

Important Facts You Should Not Miss

Image Type must match the actual format
Set Image Type to JPEG, PNG, GIF, or BMP to match the actual format of the image you supply. A mismatch between the Image Type value and the real format can cause the node to return an error or incorrect metadata. If you are unsure of the format, check the file extension or MIME type from the prior node before setting this parameter.
hasExifData tells you whether exifData is safe to use
The exifData field is null when the image has no embedded EXIF metadata - common for programmatically generated images, screenshots, and exported graphics. Always check the hasExifData boolean first before mapping exifData fields into downstream nodes. Trying to access sub-fields of a null object will cause the n8n execution to fail.
Resolution is in DPI - not pixels
horizontalResolution and verticalResolution are returned in dots per inch, not pixels. A typical web image returns 72 or 96 DPI. A print-quality image should be 300 DPI or higher. Use these fields to gate images in quality-check workflows - for example, reject images below 200 DPI for print publication and route them to a re-upload request step.
n8n PDF4me Get Image Metadata node showing Input Data Type set to Binary Data, Input Binary Field set to data, Output File Name set to image_metadata.json, Image Type set to PNG, and Async set to false

Set Input Data Type and Image Type to match your image source, enter Output File Name with .json extension, and execute. All metadata fields are available in the node output.

Parameters

Required: Input Data Type, the image source field matching that type (Input Binary Field, Base64 Image Content, or Image URL), Output File Name, and Image Type. Async is optional.

ParameterRequiredWhat it doesExample
Input Data TypeYesFormat of the source image. Choose Binary Data to map from a prior node, Base64 String for encoded image data, or URL for a publicly accessible image file.Binary Data
Input Binary FieldYes (Binary Data)The binary property name from the prior node holding the image. Must match the binary output key of the upstream node.data
Base64 Image ContentYes (Base64)Base64-encoded image string. JPEG, PNG, GIF, and BMP all accepted./9j/4AAQS...
Image URLYes (URL)Publicly accessible HTTPS URL to the image. PDF4me fetches it and returns the metadata.https://example.com/photo.png
Output File NameYesFilename for the metadata output. Use .json extension. This names the binary output item in n8n.image_metadata.json
Image TypeYesActual format of the source image. Must match the real format - JPEG, PNG, GIF, or BMP.PNG
AsyncNoWhen true, runs asynchronously and returns immediately for large image files. Results must be handled via polling or callback.false

Output Fields

FieldTypeWhat it contains
imageFormatStringDetected format of the image - Jpeg, Png, Gif, or Bmp.
fileSizeNumberSize of the original image in bytes.
widthNumberImage width in pixels.
heightNumberImage height in pixels.
orientationString | nullPortrait, Landscape, Square, or null if not encoded in the image.
bitsperPixelNumberColor depth. 32 is typical for PNG with alpha; 24 for standard JPEG.
horizontalResolutionNumberHorizontal resolution in DPI. 96 = web, 300 = print quality.
verticalResolutionNumberVertical resolution in DPI.
hasExifDataBooleanTrue if the image contains embedded EXIF metadata. Always check this before using exifData.
exifDataObject | nullCamera settings, GPS coordinates, timestamps, and other EXIF fields. Null when hasExifData is false.
hasXmpDataBooleanTrue if the image contains Adobe XMP metadata.
_metadataObjectProcessing summary - success status, message, timestamp, and operation name.

Quick Setup

  1. Add a PDF4me node and select Get Image Metadata.
  2. Choose or create Credentials with your PDF4me API key.
  3. Set Input Data Type and map the image source (binary, Base64, or URL).
  4. Set Image Type to match the actual format of your image.
  5. Enter Output File Name with .json extension and click Execute Node. Map width, height, horizontalResolution, and hasExifData into downstream nodes.

Workflow Examples

Workflow ExamplesCommon n8n workflow patterns using Get Image Metadata.
Gate print jobs by image resolution
  1. A form submission triggers when a designer uploads an image for print production.
  2. Get Image Metadata reads horizontalResolution and verticalResolution from the uploaded file.
  3. An IF node checks whether both values are 300 DPI or above.
  4. Images that pass go to the print queue in Airtable. Images that fail trigger a Slack message asking the designer to re-upload at higher resolution.
Catalog digital assets with full metadata in a database
  1. Dropbox Watch Folder triggers when a new image lands in the "Asset Intake" folder.
  2. Get Image Metadata extracts all properties including EXIF camera data if present.
  3. A Postgres or Airtable node writes a new row with the filename, dimensions, format, DPI, and EXIF date-taken to the asset catalog.
  4. The asset is moved to the "Catalogued" folder and a Slack message confirms the new entry.
Route oversized images to a resize step before publishing
  1. An HTTP webhook receives product images from an e-commerce upload form.
  2. Get Image Metadata returns the width and height of each image.
  3. An IF node routes images wider than 4000px to a Compress Image or resize step before storage.
  4. Correctly sized images skip the resize step and go straight to the product CDN upload.

Frequently Asked Questions

What metadata does this node return exactly?+
The node returns imageFormat (Jpeg/Png/Gif/Bmp), fileSize in bytes, width and height in pixels, orientation (Portrait/Landscape/Square/null), bitsperPixel (color depth), horizontalResolution and verticalResolution in DPI, hasExifData boolean, exifData object (camera make/model, GPS, timestamps - or null if absent), hasXmpData boolean, and a _metadata processing summary. All fields are available as individual mapped outputs in downstream n8n nodes.
Why do I need to set Image Type separately if PDF4me can detect the format?+
Image Type tells the PDF4me API which decoder to use for the initial parse, which improves accuracy and speed - especially for edge cases where file headers are incomplete or the binary is embedded in a Base64 string with no MIME type context. The imageFormat output field then confirms the actual detected format after processing.
How do I check if EXIF data is present before using it?+
Map the hasExifData output into an IF node condition. When hasExifData is true, route to a branch that maps exifData sub-fields (such as exifData.DateTimeOriginal or exifData.GPSLatitude). When false, skip that branch or substitute a default value. Attempting to access a property on a null exifData object will fail the n8n execution.
Can I use a public image URL instead of uploading the binary?+
Yes. Set Input Data Type to URL and enter the full HTTPS address of the image in the Image URL field. PDF4me fetches the image directly from that URL and returns the metadata. The URL must be publicly accessible - authenticated or private storage URLs will not work unless you generate a signed/pre-signed URL first.
How do I use this node to validate images before storing them?+
Add Get Image Metadata immediately after the upload trigger. Map width, height, horizontalResolution, and fileSize into IF node conditions that check your publishing requirements - for example width >= 800 AND horizontalResolution >= 72 AND fileSize <= 5000000. Images that pass all conditions proceed to storage; those that fail are rejected with a notification to the uploader. This creates a fully automated image quality gate with zero manual review.

Get Help