josephfrazier / reported-web

Web front-end for https://twitter.com/Reported_NYC: https://reported-web.herokuapp.com
https://reported-web.herokuapp.com
MIT License
10 stars 1 forks source link

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

Closed rowntreerob closed 1 year ago

rowntreerob commented 1 year ago

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 `

`

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 commented 1 year ago

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 commented 1 year ago

thank you for the reply. its taken care of or will be with updates in ios

  1. It was a webkit issue not an issue with exifr.

On Thu, Jun 15, 2023 at 2:40 PM Joseph Frazier @.***> wrote:

hey @rowntreerob https://github.com/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

— Reply to this email directly, view it on GitHub https://github.com/josephfrazier/reported-web/issues/422#issuecomment-1593757409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJQAAX2GHGEOII2FI46LLXLN6NNANCNFSM6AAAAAAZEC4V4I . You are receiving this because you were mentioned.Message ID: @.***>