Coder Social home page Coder Social logo

Comments (2)

MikeKovarik avatar MikeKovarik commented on May 17, 2024

Hello, thanks for using the library. I'm on a vacation right now so I can't fully look into it yet.

Could you elaborate about what goes with with the snippet you used. The concrete error it throws, or something I can latch onto while debugging?

gpsa() I guess we can do that. I never encountered usable and reliable altitude field in any photo so it haven't crossed my mind yet.

Url fetching in exifr is very basic. It can't handle redirects or any other difficult cases. There are many http libraries out there and not using one would require to implement it myself in exifr. That's a whole lot a of work, source of bugs, inflated file size, etc... Exifr is just the image parser (plus some sugar-y methods here and there). Sorry. You will have to fetch the file in your code and feed the buffer into exifr.

I'll get back to you when I return.
Thanks. Mike

from exifr.

MikeKovarik avatar MikeKovarik commented on May 17, 2024

Hello.
So I thought about it and I'm closing this with a no. It is a very specific request which would not bring that much of a value when compared to increased file size. But fear not. It's not like you cannot achieve what you want with already existing API.

let tags = [
  'GPSLatitude',    'GPSLongitude',    'GPSAltitude',
  'GPSLatitudeRef', 'GPSLongitudeRef', 'GPSAltitudeRef',
]
let output = await exifr.parse(file, tags)

and the output is

{
  GPSLatitudeRef: 'N',
  GPSLatitude: [ 50, 17, 58.57 ],
  GPSLongitudeRef: 'E',
  GPSLongitude: [ 14, 49, 13.06 ],
  GPSAltitudeRef: Uint8Array(1) [ 0 ],
  GPSAltitude: 252,
  latitude: 50.29960277777778,
  longitude: 14.820294444444444
}

Important to note: you cannot use 'latitude', 'longitude' in the tags argument exifr.parse(file, [...]) because those are not a real tags that can be extracted. These are calculated on the fly by exifr, if there's GPSLatitudeRef and GPSLatitude or GPSLongitudeRef and GPSLongitude in the output. So by requesting these (along with GPSAltitude) you get all you want, both in processed and raw form.

I know you mentioned some error occurred with this approach but I believe it was a typo (maybe you didn't use strings in the array), or there's a bug in exifr. In which case, I'd love to look into it if you provide me with the image.

from exifr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.