File Upload and EXIF in mobile Safari

人盡茶涼 提交于 2019-12-10 14:43:49

问题


As noted in these questions, there are cases where foto uploads on iOS have their geolocation and other EXIF metadata removed (in safari):

https://apple.stackexchange.com/questions/326789/gps-exif-from-iphone-photo-upload-in-safari

Image upload from iphone strips exif data

As of now, I have not found a proper description of the circumstances when this happens. I have 2 devices for testing with the latest iOS installed where EXIF metadata is NOT stripped.

Is there a way to determine, most hopefully in the browser or from the upload, if the metadata has been stripped in order to show some kind of info to the user?


回答1:


Little hard to understand your use case here, but if the idea is to show EXIF has been removed (or not) when a user uploads a file from inside your app, you could inject a script to include this library https://github.com/exif-js/exif-js and then show the result of the EXIF data in a UIAlertView?




回答2:


There are now methods to access raw <input type="file"> tag information. This enables you to take your desired EXIF data, put it in a concealed form field, and send it with the real upload of the file.

To get the EXIF:

  1. Create a button that calls a function to generate the file input and add a change handler.
  2. Then, In the file change handler use $(this).get(0).files to get the list of selected files.
  3. Parse the exif data and send the browse results to jsjpegmeta.

This way you can get all the exif Information before its removed.



来源:https://stackoverflow.com/questions/57942150/file-upload-and-exif-in-mobile-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!