Native image and meta data retrieval from Canon RAW .CR2 files.
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());
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.
Retrieves 'Exif.Photo.PixelXDimension' from the EXIF IFD and
returns it as an int
.
Retrieves 'Exif.Photo.PixelYDimension' from the EXIF IFD and
returns it as an int
.
Retrieves 'Exif.Photo.DateTimeOriginal' from the EXIF IFD and
returns it as a Date
.
filePath
string - Path to .CR2 file
Basic constructor used to parse a .CR2 file ready for use.
Returns a Buffer
containing the bytes which make up the preview image for the
file.
Returns a Buffer
containing the bytes which make up the thumbnail image for
the file.
metaDefinition
object - Meta data definition (see MetaDefinitions)
Retrieves and returns a piece of meta data depending on the passed MetaDefintion.