0

I have a function that gave me this JSON back:

{
   "ImageWidth":3000,
   "ImageHeight":2002,
   "Orientation":1,
   "originalUri":"IMG_0005.JPG",
   "exif":{
      "{TIFF}":{
         "Model":"NIKON D800E",
         "ResolutionUnit":2,
         "Software":"Aperture 3.4.5",
         "Artist":"Nicolas Cornet",
         "DateTime":"2012:08:08 14:55:30",
         "XResolution":72,
         "Orientation":1,
         "Copyright":"Nicolas Cornet",
         "Make":"NIKON CORPORATION",
         "YResolution":72
      }
   }
}

Can anyone tell me how I can access the {TIFF} in React-Native (TypeScript)?

Json.exif.TIFF doesn't work!

What function have these braces/ curly brackets around TIFF? Thanks!

1 Answer 1

1

you can use brackets to put a string literal/variable to access the json values

let data = {"ImageWidth":3000,"ImageHeight":2002,"Orientation":1,"originalUri":"IMG_0005.JPG","exif":{"{TIFF}":{"Model":"NIKON D800E","ResolutionUnit":2,"Software":"Aperture 3.4.5","Artist":"Nicolas Cornet","DateTime":"2012:08:08 14:55:30","XResolution":72,"Orientation":1,"Copyright":"Nicolas Cornet","Make":"NIKON CORPORATION","YResolution":72}}}

console.log(data.exif["{TIFF}"])

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.