title: adding metadata in Image file created from base64 string javascript
body: <p>I have an existing code which converts base64 string to corresponding image file. Now, I want to add some metadata like last modified date, photographer, copyright, credits etc. <strong>Tried below which did not work</strong>. Is there a way I could add the metadata?</p>
  
  <p>here base64Source is the dataUri from which I am getting base 64 content.</p>
  
  <pre><code>function (base64Source, name) {
          var base64Content = base64Source.substr(base64Source.indexOf(',') + 1);
  
          var byteString = window.atob(base64Content);
          var ia = new Uint8Array(byteString.length);
          for (var i = 0; i &lt; byteString.length; i++) {
              ia[i] = byteString.charCodeAt(i);
          }
  
          var file = new Blob([ia], {type: 'image/jpeg'});
          return new File([the_file], name);
      };
  </code></pre>
  
  <p>I modified this piece of code as</p>
  
  <pre><code>function (base64Source, name) {
          var base64Content = base64Source.substr(base64Source.indexOf(',') + 1);
  
          var byteString = window.atob(base64Content);
          var ia = new Uint8Array(byteString.length);
          for (var i = 0; i &lt; byteString.length; i++) {
              ia[i] = byteString.charCodeAt(i);
          }
  
          var file = new Blob([ia], {type: 'image/jpeg'});
          return new File([the_file], name,{
              lastModified: new Date().getTime(), 
              tooltip : 'test tooltip',
              caption : 'test caption',
              copyright : 'Test',
              credits : 'Test'
          });
      };
  </code></pre>