问题
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:
- Create a button that calls a function to generate the file input and add a change handler.
- Then, In the file change handler use
$(this).get(0).files
to get the list of selected files. - 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