Socket
Socket
Sign inDemoInstall

metalsmith-media-metadata

Package Overview
Dependencies
10
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metalsmith-media-metadata

Adds metadata to image and video metalsmith file objects


Version published
Maintainers
1
Install size
269 kB
Created

Readme

Source

metalsmith-media-metadata

build status codecov Greenkeeper badge

Adds metadata to image and video metalsmith file objects. Only really useful when used in conjunction with other plugins.

Example

The output of exiftool is added as metadata into the metalsmith file object for any media file:

{
  'dog.jpg': {
    // Existing file data untouched
    exif: {
      Sharpness: 'Normal',
      SubjectDistanceRange: 'Unknown',
      GPSLatitudeRef: 'North',
      GPSLongitudeRef: 'East',
      GPSAltitudeRef: 'Above Sea Level',
      GPSTimeStamp: '14:27:07.24',
      GPSSatellites: '06',
      GPSImgDirectionRef: 'Unknown ()',
      GPSMapDatum: 'WGS-84   ',
      GPSDateStamp: '2008:10:23',
      Compression: 'JPEG (old-style)',
      ThumbnailOffset: 4560,
      ThumbnailLength: 6702,
      ImageWidth: 640,
      ImageHeight: 480,
      EncodingProcess: 'Baseline DCT, Huffman coding',
      BitsPerSample: 8,
      ColorComponents: 3,
      // Many, many fields...
    }
  }
}

Usage

const mediaMetadata = require('metalsmith-media-metadata');

metalsmith.use(mediaMetadata({
  // Only process jpegs
  path: '**/*.+(jpg|jpeg)'
}));

There are two configuration options:

  • cache: Save exif data alongside images (default: false)
  • path: minimatch case-insensitive glob that determines which files get processed (default: **/*.+(gif|jpg|mp4|png))

Requirements

Changelog

  • 0.1.0: Add cache option
  • 0.0.4: Update default search path to match subdirectories
  • 0.0.3: Fix bug where paths were not relative to metalsmith.source()
  • 0.0.2: Package metadata update, no changes
  • 0.0.1: Initial release
  • metalsmith-image-dimensions: Adds width and height to img tags.

Miscellaneous

Sample images used in tests taken from ianare/exif-samples

Sample video from the Internet Archive

Keywords

FAQs

Last updated on 08 Nov 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc