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

lat , long from exifr.gps -> NaN on ios 15 - desktop and android 13 are fine #422

Closed
rowntreerob opened this issue Jun 13, 2023 · 2 comments

Comments

@rowntreerob
Copy link

i looked over #360 but my issue is the reverse

using input.type=file.accept=png&jpeg i have no issues with:
android photo direct to consuming service
ios photo uploaded to laptop then posted to service from laptop using ios photo

But , using safari / ios , when i select camera and take photo
AND
when on safari i select "choose files" to supply existing image from photo roll

Im getting a NaN error server-side on the call below in node using exifr:

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

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

i will try rm on the "accept" attribute in the input tag in html to see if that resolves it.

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

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(

my wild ass guess would be that somehow on ios/safari, the content-type header is screwing up something

@josephfrazier
Copy link
Owner

hey @rowntreerob, I'm sorry to see you're having trouble here, but I can't really provide support, as I don't maintain exifr, nor am I familiar with your project. Maybe the exifr repo or stackoverflow would be a better place to ask

@rowntreerob
Copy link
Author

rowntreerob commented Jun 15, 2023 via email

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

2 participants