Extracting EXIF data with JavaScript

6.3k Views Asked by At

I'm evaluating image upload techniques using Canvas for a mobile web app. The sticking point is reading EXIF data client-side. Other discussions on this site point towards the excellent Blueimp JavaScript Image Load. I particularly want to extract from EXIF:

  • date & time of photo taken
  • Geopositioning - latitude & longitude of photo taken

Testing the Blueimp script on Firefox v.33.1 on Windows Vista using a photo taken on an iPhone (with geo data), it successfully extracts all the EXIF data including date, time & geocoords. Running the same test with the same photo on iOS and it only extracts a tiny amount of EXIF data - just the dimensions and orientation (I'm using iPhone 5, iOS 8.1), nothing else. Why is this? Is there a fix or an alternative JavaScript EXIF extraction tool to recommend?

Suggestions very gratefully received as this is doing my head in!! Thanks in advance.

Please note: I don't want to do it server-side with PHP because this requires uploading the full image, which can be slow on mobile bandwidth, hence going for the canvas option to resize images client-side.

1

There are 1 best solutions below

0
On

After more reading around on this issue, a similar question was asked here a year ago, with no satisfactory responses. According to one commenter, uploaded files on iOS devices only get access to a sanitized version of the file for privacy reasons. This means what useful stuff like time/date and GPS is stripped out of a file before it is made available to the browser.

Which kind of scuppers this idea. :(