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

cr2-raw

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cr2-raw

Native image and meta data retrieval from Canon RAW .CR2 files.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by166.67%
Maintainers
1
Weekly downloads
 
Created
Source

cr2-raw

Native image and meta data retrieval from Canon RAW .CR2 files.

Usage

This is just a quick example that demonstrates retrieving the preview image from a .CR2 file.

var cr2Raw = require('cr2-raw'),
  fs = require('fs');

// Read RAW.
var raw = cr2Raw('my-image.CR2');

// Save preview image.
fs.writeFileSync('my-image.jpg', raw.previewImage());

API

cr2raw

Static
meta

MetaDefinitions describe how to find a specific tag including the tagId, which IFD's to search for it and a parse function to use on the return value.

ImageWidth
Description

Retrieves 'Exif.Photo.PixelXDimension' from the EXIF IFD and returns it as an int.

ImageHeight
Description

Retrieves 'Exif.Photo.PixelYDimension' from the EXIF IFD and returns it as an int.

DateTaken
Description

Retrieves 'Exif.Photo.DateTimeOriginal' from the EXIF IFD and returns it as a Date.

Construction
cr2Raw(filePath)
Parameters
  • filePath string - Path to .CR2 file
Description

Basic constructor used to parse a .CR2 file ready for use.

Methods
previewImage()
Description

Returns a Buffer containing the bytes which make up the preview image for the file.

thumbnailImage()
Description

Returns a Buffer containing the bytes which make up the thumbnail image for the file.

fetchMeta(metaDefinition)
Parameters
  • metaDefinition object - Meta data definition (see MetaDefinitions)
Description

Retrieves and returns a piece of meta data depending on the passed MetaDefintion.

Keywords

FAQs

Package last updated on 25 Mar 2019

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