npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

photo-info

v0.3.4

Published

[![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

Downloads

779

Readme

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)