Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rowntreerob opened this issue Jun 13, 2023 · 0 comments
Open

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

rowntreerob opened this issue Jun 13, 2023 · 0 comments

Comments

@rowntreerob
Copy link

rowntreerob commented Jun 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant