Lightweight Angular directive wrapper of exif-js (https://github.com/exif-js/exif-js) for reading EXIF image metadata
-
Install with bower:
bower install ng-exif --save
-
Add script references. exif.js must come before ng-exif.js:
<script src='/bower_components/exif-js/exif.js'></script> <script src='/bower_components/ng-exif/ng-exif.js'></script> -
Inject ng-exif into your module:
angular.module('app', ['ng.exif']);
- When a file or files are selected exif.js verifies if it is a jpg image.
- If the file is a valid jpg image then exif.js grabs all the meta data it can from it
- exif.js adds two properties: exifdata and iptcdata
- ng-exif makes sure that those two properties are added to the particular scope object
Normally used with other angular libraries such as:
- angular-file-model (https://github.com/ghostbar/angular-file-model)
- ng-file-upload (https://github.com/danialfarid/ng-file-upload).
Here is an example with angular-file-model
<input type='file' file-model='imageFile' ng-exif-file='imageFile'>