V
V
vita_run2018-03-17 13:54:40
satellite navigation
vita_run, 2018-03-17 13:54:40

How to extract only GPS data from EXIF ​​using piexifjs (Node.js) module?

How to output only GPSLongitude and GPSLatitude from EXIF ​​data to console instead of outputting all EXIF ​​using piexif module?

var piexif = require("piexifjs");
var exifObj = piexif.load('myImage.jpg');
for (var ifd in exifObj) {
    if (ifd == "thumbnail") {
        continue;
    }
        console.log("-" + ifd);
        for (var tag in exifObj[ifd]) {
            console.log("  " + piexif.TAGS[ifd][tag]["name"] + ":" + exifObj[ifd][tag]);
        }
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-03-17
@freeExec

Pick the [ifd][tag] you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question