4

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.

Community
  • 1
  • 1
rmcm
  • 61
  • 1
  • 4
  • Further testing on the Blueimp script: full EXIF data is also successfully extracted using Samsung Galaxy Android phone and a Nokia Windows. Only iphone is the problem. The mystery deepens. – rmcm Nov 21 '14 at 13:28
  • Digging deeper, I am now testing **[EXIF-JS the JavaScript library for reading EXIF image metadata](https://github.com/jseidelin/exif-js)**. On iPhone, it appears to work fine on embedded images, but the same problem appears with image upload. Is it to do with the file path on iOS perhaps? – rmcm Nov 27 '14 at 11:33
  • A further JS library is **[JSJPEGmeta](https://github.com/bennoleslie/jsjpegmeta)** - interesting results on iOS, a wider range of image metadata extracted, but still lacking in GPS data. Why does iPhone fail to read this bit of data? – rmcm Nov 27 '14 at 12:08

1 Answers1

2

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. :(

Community
  • 1
  • 1
rmcm
  • 61
  • 1
  • 4