File Metadata Extractor
AI-generatedOverview
This node extracts metadata from various file types including PDFs, images, markdown files, eBooks (EPUB), ZIP archives, Word documents, Excel spreadsheets, audio files, and video files. It is useful for workflows that require detailed information about files, such as document management, media cataloging, or content analysis. For example, it can extract the number of pages and author from a PDF, EXIF data from images, front matter from markdown files, or duration and codec information from audio and video files.
Use Case Examples
- Extract metadata from uploaded PDF files to catalog document properties.
- Analyze image files to retrieve camera and GPS information from EXIF data.
- Process audio files to get duration, bitrate, and artist information for media libraries.
Properties
| Name | Meaning |
|---|---|
| Binary Property | Name of the binary property containing the file to extract metadata from. |
| File Type | Type of file to extract metadata from, with options to auto detect or specify formats like PDF, image, markdown, EPUB, ZIP, Word, Excel, audio, or video. |
| Output Binary Data | Whether to include the original binary data in the output to prevent data bloat when connecting to certain inputs. |
Output
Binary
Includes original binary file data if enabled in input properties.
JSON
fileName- Original file name of the binary data.mimeType- MIME type of the file.fileSize- Size of the file in bytes.fileSizeFormatted- Human-readable file size (KB or MB).detectedFileType- Detected or specified file type for metadata extraction.autoDetectMode- Indicates if auto detection mode was used for file type.fileExtension- File extension extracted from the file name.title- Title metadata extracted from the file (if available).author- Author metadata extracted from the file (if available).subject- Subject metadata from EPUB files.keywords- Keywords metadata extracted from the file (if available).creator- Creator metadata extracted from the file (if available).producer- Producer metadata extracted from the file (if available).creationDate- Creation date metadata extracted from the file (if available).modificationDate- Modification date metadata extracted from the file (if available).numberOfPages- Number of pages in PDF files.exif- EXIF metadata extracted from image files.make- Camera make from image EXIF data.model- Camera model from image EXIF data.dateTime- Date and time from image EXIF data.width- Image width in pixels.height- Image height in pixels.orientation- Image orientation from EXIF data.gpsLatitude- GPS latitude from image EXIF data.gpsLongitude- GPS longitude from image EXIF data.iso- ISO setting from image EXIF data.exposureTime- Exposure time from image EXIF data.fNumber- F-number (aperture) from image EXIF data.focalLength- Focal length from image EXIF data.software- Software used to process the image.artist- Artist metadata from image or media files.copyright- Copyright metadata from image files.frontMatter- Front matter data extracted from markdown files.hasContent- Indicates if markdown file has content beyond front matter.contentLength- Length of markdown content in characters.wordCount- Word count of markdown content.publisher- Publisher metadata from EPUB files.language- Language metadata from EPUB files.date- Date metadata from EPUB files.description- Description metadata from EPUB files.rights- Rights metadata from EPUB files.isbn- ISBN metadata from EPUB files.toc- Table of contents from EPUB files.spine- Spine structure from EPUB files.metadata- Additional metadata from EPUB files.fileCount- Number of files in ZIP archive.files- List of files with details in ZIP archive.totalSize- Total uncompressed size of ZIP archive.totalCompressedSize- Total compressed size of ZIP archive.compressionRatio- Compression ratio of ZIP archive.textLength- Length of extracted text from Word documents.messages- Messages or warnings from Word document extraction.sheetCount- Number of sheets in Excel spreadsheet.sheets- Details of each sheet including rows, columns, and cell count.properties- Properties metadata from Excel files.format- Format details from audio or video files.duration- Duration of audio or video in seconds.durationFormatted- Formatted duration as minutes and seconds.bitrate- Bitrate of audio or video file.sampleRate- Sample rate of audio file.numberOfChannels- Number of audio channels.codec- Codec used in audio or video file.container- Container format of audio or video file.common- Common metadata tags from media files.album- Album metadata from audio files.year- Year metadata from audio files.genre- Genre metadata from audio files.track- Track number metadata from audio files.albumArtist- Album artist metadata from audio files.composer- Composer metadata from audio files.comment- Comments metadata from media files.error- Error message if metadata extraction failed.message- Additional message or note about metadata extraction.extractionError- Error message caught during metadata extraction.namespace- Sanitized title or identifier for namespace use.
Dependencies
- pdf-parse
- gray-matter
- epub
- adm-zip
- exifr
- mammoth
- xlsx
- music-metadata
- util
- path
- fs
Troubleshooting
- If the file type is not supported or incorrectly detected, ensure the file extension and MIME type are correct or specify the file type manually.
- Errors parsing specific file types may occur if the file is corrupted or not a valid format; check the file integrity.
- For audio and video files, ensure the file format is supported by the underlying music-metadata library.
- If metadata extraction fails, the error message is included in the output for debugging.
- Disabling binary output can help prevent data bloat when connecting to certain inputs like vector processing.
Links
- pdf-parse - Library used for extracting PDF metadata.
- gray-matter - Library used for parsing markdown front matter.
- epub - Library used for parsing EPUB metadata.
- adm-zip - Library used for reading ZIP archive metadata.
- exifr - Library used for extracting image EXIF metadata.
- mammoth - Library used for extracting Word document text and metadata.
- xlsx - Library used for reading Excel spreadsheet metadata.
- music-metadata - Library used for extracting audio and video metadata.