Extracting tags from libraw_gps_info_t

Hi,

So, I am trying to extract the information from the tag longref, altref, etc. longref should be chars either E or W, but if I access it by libraw I am getting some weird characters, I am accessing it via imgdata.other.parsed_gps.longref What might be the issue?

--KaroTK

Forums: 

Sample

I can't find a way to attach a file, but here is a sample code that fails. I an extracting a lot of information so I am putting everything into a stream.

#include "libraw/libraw.h"
#include < iostream >
#include < sstream >

void getGPSinfo(string fileName)
{
LibRaw proc;
FILE *pf;
ostringstream stream;
proc.open_file(fileName);

libraw_gps_info_t GPSInfo = proc.imgdata.other.parsed_gps;

stream << "\"GPSAltitudeRef\"" << "->" << to_string(GPSInfo.altref);

pf = fopen("somePath\\debug.txt", "w");
fprintf(pf, stream.str().c_str());
fclose(pf);
proc.recycle();

}

I sent a project to your

I sent a project to your email. Please note that checkMetadataValue is written so, that if the value is absent then it should return "Missing", also note that even though it extracts altitude, after failing to extract longref it stops and does nothing with the rest of the file.

Also, I am concerned about other fields in GPS, for instance longitude returns 0s no matter what image I try.

The only things I need is the

The only things I need is the RAW file to see is LibRaw correctly parses GPS fiield or not.

-- Alex Tutubalin

BTW no message(s) in inbox

BTW no message(s) in inbox yet.....

Please use some file sharing service because E-mail providers/servers may limit message size

-- Alex Tutubalin

Okay, I'll upload another one

Okay, I'll upload another one soon. However how does LibRaw handle these cases? I mean if the tag is absent and I try to access its contents what is the expected result? Or better yet, is there a good way of checking it?

imgdata.other.gpsdata

imgdata.other.parsed_gps.gpsparsed is non-zero if gps data has parsed.

-- Alex Tutubalin