all files / src/ exif_utils.js

90% Statements 9/10
100% Branches 2/2
100% Functions 2/2
90% Lines 9/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221× 1×   1× 5× 5× 5× 2×     3×                 1×    
var log = require('electron-log');
var ExifImage = require('exif').ExifImage;
 
function get_exif_from_image(path, cb) {
    try {
        new ExifImage({image: path}, function (error, exifData) {
            if (error) {
                cb(error.message);
            }
            else {
                cb(null, exifData);
            }
        });
    } catch (error) {
        log.error('Error: ' + error.message);
    }
}
 
 
module.exports = {
    'get_exif_from_image': get_exif_from_image
};