Image upload from iPhone strips exif data

前端 未结 11 1495
耶瑟儿~
耶瑟儿~ 2020-12-05 04:09

I\'ve built a website which allows image uploading and once an image is uploaded , some specific information about the photo is displayed. Uploading pictures from computers

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 04:50

    Unfortunately, itamar (op) if you upload from iphone to a server (as is my case), the IFDO: MAKE is stripped. If pic is saved on iphone and emailed, the data is there.

    I need the MAKE info in order to rotate photos correctly. ORIENTATION value is different for Apple and Android and if I had the MAKE i could code to adapt. Cannot understand what the secrecy concerns could be with knowing what device took the picture.

    Short of Apple allowing user to select PIC data info to be uploaded, maybe in SETTINGS, possible solutions:

    • creating code to UPLOAD saved file (not share the picture) to server location and then attaching/adding to final place
    • using commercial apps to upload, like http://www.transloadit.com
    • rather than depending upon the EXIF data of MAKE, I just decided on finding out the device and o/s used to send data. Will explore "client_agent" as starting point.

    Just got this idea from looking at the RESULT JSON from uploading to TRANSLOADIT. It clearly has the data we need:

    "client_agent": "Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/34.0.1847.18 Mobile/11D201 Safari/9537.53",

    If they can "see" the o/s and device, so can we.

    If we get that data, then it can be added to pic EXIF and used elsewhere.

    Hope this helped.

    EDIT: data from Windows PC to illustrate when using "echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";"

    FROM PC: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 File

    FROM IPAD: "Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/34.0.1847.18 Mobile/11D201 Safari/9537.53",

    EDIT: added rference to php.net and get browser: http://www.php.net/manual/en/function.get-browser.php

提交回复
热议问题