Skip to content

exifr.gps -> NaN on ios 15 - desktop and android 13 are fine #114

@rowntreerob

Description

@rowntreerob

--its an ios feature on <16.4 -- details

on mobile, using std html input type file with JS getting the file's binary bytes and doing a fetch.post using content-type application/octet-stream.

The only way i can get the iphone to work is to use the camera and not the html to take a photo and to then upload the iphone's photo to a laptop where i use the html that is not working on ios safari.

works from laptop
works from android 13 on phone
causes NaN error addressing lat, long after exifr.gps call

my only wild guess is to try other content-type headers on safari??

metadata is clearly in the ios photo but when safari implements js below the metadata is stripped out

html
<input type="file" id="files" name="files[]" accept="image/png, image/jpeg" title="" />

javascript:

function HandleBrowseClick()
 { upload(file)}
const domain = 'awsgcpupld-production.up.railway.app'
const upload = (file) => {
  let url1 = `https://${domain}/labelai/${file.name}`;
  console.log(url1)  
  fetch(url1, { 
    method: 'POST',
    headers: {
      "application":"awsgcpupld-production.up.railway.app",   
      "Content-Type": "application/octet-stream",
      "authorization":"Bearer "
    },
    body: file // this is binary file from the input tag in html 
  }).then(

server-side node causing error works everywhere except when client is ios/safari ios 15

let {latitude, longitude} = await exifr.gps(req.body);

middleware handler for "req.body" :

app.use(express.raw({
	inflate: true,
    limit: '9mb',
    type: 'application/octet-stream'})) 

above code in express route where req.body is uploaded binary file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions