Skip to content

Conversation

@Cyrildavids
Copy link

@Cyrildavids Cyrildavids commented Aug 6, 2017

For some reason when i try to use this in an Angular Application it complains about fs.readFile not existing. So i resorted to using the base64 version of the image binary. I had to modify the library to accept base64 string without interfering with any of the processes that are already exists except converting base64 string to an array buffer and then on to a Buffer ready for processing.
An example usage will be
new EXIFImage({ image: this.base64Image, imageDataType: 'base64' }, function (error, exifData) { if (error) console.log('Error: ' + error.message); else { console.log(exifData); // Do something with your data! } });
or
new EXIFImage({ image: this.arrayBuffer, imageDataType: 'ArrayBuffer' }, function (error, exifData) { if (error) console.log('Error: ' + error.message); else { console.log(exifData); // Do something with your data! } });

@oeuillot
Copy link
Collaborator

oeuillot commented Aug 7, 2017

Hello,
Why dont you use UInt8Array.from(source) ?

https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/TypedArray/from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants