简体   繁体   中英

How universal is exif data in mobile phones?

I am making an app that uses exif.js https://github.com/exif-js/exif-js to read some exif data from the image the camera captures. The specific fields that I want is ImageWidth , ImageHeight , FocalLength , FocalLengthIn35mmFilm and Orientation . But I want to use the app on any phone. Does anyone know how universal this is? Does all phones camera put in this data? I tested on a samsung note 4 and it was able to get these data.

Thanks

The vast majority of cameras create exif data when they capture a picture. It'd be difficult to give a total percentage, but you can safely assume that most user's cameras will capture exif data.

To give you an idea, Flickr captures and publishes exif data for photos uploaded to its site. You can view the most popular cameras in use here: https://www.flickr.com/cameras

You can view the EXIF specification here: http://www.exif.org/Exif2-2.PDF Go to page 24 for attribute names. To my knowledge, not many phones or camera break the standard.

Most cameras put EXIF in the photos and there's a spec (EXIF 2.2 or TIFF6.0) for defining the default tags. Manufacturers always use the standard tags (ImageWidth, ISO, FocalLength, Orientation, etc...) and only add their own for additional data that doesn't fit any standard tags but. You don't need to worry that they would use proprietary tag instead of one already covered in the EXIF standard. Ie, if you can't find ImageWidth, don't worry about looking for PhotoWidth or anything else. The width info just isn't in the photo in this case.

You can also encounter some data stored in different data structures entirely - such as XMP (XML format, mostly used in panoramas or drone photos), ICC (color profiles), IPTC (descriptions, author info, copyright, etc...)

Also. I'd like to offer alternative library exifr . I've written it because exif-js is pretty much dead now (left unmaintained for over 2 years now) and it's ineffective. Whereas exifr was built to be super efficient, supports all the aforementioned data segments, the new HEIC file format, and more...

You can also try out the library's playground and experiment with images and their output, or check out the repository and docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM