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

photo-info

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

photo-info

[![npm version](https://img.shields.io/npm/v/photo-info.svg?style=flat-square)](https://www.npmjs.com/package/photo-info) [![Build](https://github.com/tyom/photo-info/actions/workflows/build.yaml/badge.svg)](https://github.com/tyom/photo-info/actions/work

  • 0.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by1400%
Maintainers
0
Weekly downloads
 
Created
Source

Photo Info

npm version Build

This package provides a function to extract useful information from photos, such as geo location, camera make and model, focal length and angle of view, which could be useful to orient the photo on the map.

Demo App

Try the demo app with a few geotagged photos. All photos operations are done in the browser. No data is sent to any server.

Installation

npm install photo-info

Usage

import { getPhotoInfo } from 'photo-info';

const { angleOfView, bearing, position, make, model } =
  await getPhotoInfo(file);

To get the original EXIF data, set the includeOriginalTags parameter to true.

const { originalTags, ...photoInfo } = await getPhotoInfo(file, true);
await getPhotoInfo(file);

The getPhotoInfo function returns an object with the following properties:

  • make: the camera make
  • model: the camera model
  • angleOfView: the angle of view of the photo in degrees
  • bearing: the bearing of the photo in degrees
  • gpsPosition: the position of the photo as a [Latitude, Longitude, Altitude?] tuple
  • gpsSpeed: the speed the camera was moving at { value: number, description: 'km/h' }
  • focalLength: the focal length of the camera in millimeters
  • focalLengthIn35mm: the focal length of the camera in 35mm equivalent millimeters
  • width: the width of the photo in pixels
  • height: the height of the photo in pixels
  • orientation: the orientation of the photo (portrait, landscape, or square)
  • frontCamera: whether the photo was taken with the front camera
  • dateTime: the date and time the photo was taken in ISO format
  • exposureTime: the exposure time of the photo in seconds
  • exposureProgram: the exposure program setting in the camera
  • fNumber: the f-number (aperture) of the lens
  • lens: the lens used to take the photo
  • originalTags: the original EXIF tags of the photo (when the second argument of getPhotoInfo is set to true)

Keywords

FAQs

Package last updated on 25 Oct 2024

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