Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. export function blobToFile(theBlob, fileName){
  2. theBlob.lastModifiedDate = new Date();
  3. theBlob.name = fileName;
  4. return theBlob;
  5. }
  6.  
  7. export function removeExif(image) {
  8.  
  9. return new Promise ((res, rej) => {
  10.  
  11. loadImage(image, (img) => {
  12.  
  13. if(img.type === "error") {
  14. return rej('error loading image');
  15. }
  16.  
  17. img.toBlob(blob => {
  18.  
  19. const file = blobToFile(blob, image.name);
  20.  
  21. return res(file);
  22.  
  23. })
  24.  
  25. }, {
  26. canvas: true,
  27. orientation: true
  28. });
  29.  
  30. })
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement