javascript - Can't get EXIF info using loadImage.parseMetaData -
I load javascript image. I'm using Parsmade_Data () so that I can try to orient an image on the Web, so I will rotate it.
If I see the orientation in hardcodes (see "Orientation: 3" in my second load image call), then I can rotate it ... but I use loadImage.parseMetaData to get orientation I am trying to do
I have used Web based Exhibence Parsers and orientation information is in the image.
When I call load image The UltimateData "data.exif" appears blank. See this Bela:
var xhr = New XMLHttpRequest (); Xhr.open ('GET', 'http://www.filepicker.io/api/file/U0D9Nb9gThy0fFbkrLJP', true); Xhr.responseType = 'blob'; Xhr.onload = function (e) {if (this.status == 200) {// Note: Response instead of .responseText console.log ("Found Image"); Var blob = new blob ([this.response], {type: 'image / png'}); Console.log ("About parsing Blob:" + _.pairs (this.response)); LoadImage.parseMetaData (blob, function) {console.log ("EXIF:" + _.pairs (data)) var ori = "initial"; if (data.exif) {ori = data.exif.get (' Orientation ');} console.log ("ori:" + ori;)}); Var loadImage = loadImage {blob, function (img) {console.log ("in loading image"); document.bad.appendChild (img);}, {maxWidth: 600, Orientation: 3, canvas: true, crossOrigin: ' Anonymous'}); If (! LoadingImage) {// Optional Code ...}}}; Xhr.send (); > To load your call IMS, you need to parse the metadata to call from within the callback.
Reason: As you have a race condition in your code. The call is likely to be called a long-loaded image, the parsmatadata is completed and due to the fact the orientation is filled that they are both asynchronous calls.
Comments
Post a Comment