Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exif-js

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exif-js

JavaScript library for reading EXIF image metadata

  • 2.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
87K
decreased by-7.96%
Maintainers
3
Weekly downloads
 
Created

What is exif-js?

The exif-js npm package is a JavaScript library that allows you to extract EXIF (Exchangeable Image File Format) metadata from image files. This metadata can include information such as the camera model, exposure time, GPS location, and more.

What are exif-js's main functionalities?

Extract EXIF Data

This feature allows you to extract all EXIF metadata from an image file. The code reads an image file and uses the `getData` method to extract the metadata, which is then logged to the console.

const EXIF = require('exif-js');
const fs = require('fs');

fs.readFile('path/to/image.jpg', (err, data) => {
  if (err) throw err;
  EXIF.getData(data, function() {
    const allMetaData = EXIF.getAllTags(this);
    console.log(allMetaData);
  });
});

Get Specific EXIF Tag

This feature allows you to extract a specific EXIF tag from an image file. The code reads an image file and uses the `getTag` method to extract the 'Make' tag, which is then logged to the console.

const EXIF = require('exif-js');
const fs = require('fs');

fs.readFile('path/to/image.jpg', (err, data) => {
  if (err) throw err;
  EXIF.getData(data, function() {
    const make = EXIF.getTag(this, 'Make');
    console.log('Camera Make: ' + make);
  });
});

Get GPS Data

This feature allows you to extract GPS data from an image file. The code reads an image file and uses the `getTag` method to extract the 'GPSLatitude' and 'GPSLongitude' tags, which are then logged to the console.

const EXIF = require('exif-js');
const fs = require('fs');

fs.readFile('path/to/image.jpg', (err, data) => {
  if (err) throw err;
  EXIF.getData(data, function() {
    const gpsData = {
      latitude: EXIF.getTag(this, 'GPSLatitude'),
      longitude: EXIF.getTag(this, 'GPSLongitude')
    };
    console.log('GPS Data: ', gpsData);
  });
});

Other packages similar to exif-js

Keywords

FAQs

Package last updated on 10 Sep 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc