0

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

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
omega
  • 40,311
  • 81
  • 251
  • 474

2 Answers2

0

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 phones I guess will put in some exif data, but will they always be the same set of properties with the same exact names? – omega Jul 20 '16 at 16:20
  • Width, height, focal length, and orientation are all a given. I'm not 100% sure about FocalLengthIn35mmFilm unfortunately. – GeoGeoGeometry Jul 20 '16 at 16:21
0

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. I.e., 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.

Mike Kovařík
  • 244
  • 2
  • 8