Skip to content
/ cr2-raw Public
forked from anierzad/cr2-raw

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

License

Notifications You must be signed in to change notification settings

Ray9T/cr2-raw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%