jpegMetadataParser is in the shared directory so I'm assuming that the goal is to provide a generic way to parse images in Gaia. I would think longer term and make this piece of code as generic as we can. For instance, in iOS you have the official camera app but you also have alternative photography applications made by 3rd parties. It would open tons of opportunities if we can make the parser more flexible and usable, not tailored to a specific use case. 

Coming back to the commented snippet. Your code returns 'undefined' for metadata.orientation if the EXIF orientation tag is 2, 4, 5 or 7.