File Upload and EXIF in mobile Safari

前端 未结 3 1095
心在旅途
心在旅途 2021-01-18 01:10

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.stackexchang

相关标签:
3条回答
  • 2021-01-18 01:58

    I can tell you right now that with my iPhone X and IOS 13.3 (current) the exif data is stripped if I use the default Settings->Camera->Formats setting, which is 'High Efficiency'. But if I change that to 'Most Compatible', the EXIF data is not stripped. These results are consistent if I do not manipulate the photo at all on my phone before uploading.

    It looks like photos that are shot under 'High Efficiency' mode do upload with EXIF data if they have been edited on the phone first - but I have not done extensive testing to verify if this is always the case or under what conditions this always works.

    0 讨论(0)
  • 2021-01-18 02:02

    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?

    0 讨论(0)
  • 2021-01-18 02:08

    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.

    0 讨论(0)
提交回复
热议问题