Set Exif GPS latitude information.

Login to reply to this topic.
Mon, 2006-12-04 11:22
Joined: 2004-12-27
Forum posts: 15
Hi All,
I am using the CExifModify class to set the latitude information for an
image on S603rd Edition FP1.
The function which is used to set the tag is as follows.
CExifModify::SetTagL( TExifIfdType aIfdType, TExifTagInfo aTagInfo, const
TDesC8& aTagData )

Here,
the aTagData is to contain the latitude information.
I am able to set the latitude  and longitude reference values as these tags
accept the data in ascii format.

However, the data type expected for the latitude is of type rational .
The latitude information i have is in TReal64 format. My problem is how do i
convert the
available TReal64 information into the descriptor format.


using AppendNum doesn't work, and it returns a KErrArgument error.
What is the correct syntax of using the SetTagL method.  for setting
latitude information ?

Kindly help,


Shashi.

Mon, 2006-12-04 13:54
Joined: 2004-11-29
Forum posts: 1156
Re: Set Exif GPS latitude information.
You can try use the Format() function.

you find the format string syntax here:
Symbian OS Guide
    C++ API guide
        Base
            Using User Library (E32)
                Buffers and Strings
                    Using Descriptors
                        How to Use Descriptors
                            Format string syntax


%f seems to be useful for your needs.

Code:
Format(_L("%f"),myvalue);

There is an AppendFormat too.
Tue, 2006-12-05 10:14
Joined: 2004-12-27
Forum posts: 15
Re: Set Exif GPS latitude information.
Hi Alh,
Thanks for the reply. However using either Format or AppendFormat does not help.
I tried to set, say a latitude value of 10.1234 using

buf.Format(_L8("%f"),10.1234);

This when passed to the SetTagL function, it still leaves with the reason code -6. (KErrArgument).
Tue, 2006-12-05 10:29
Joined: 2004-11-29
Forum posts: 1156
Re: Set Exif GPS latitude information.
Oh, I see...
misunderstood the problem slightly

I have never used the SetTagL so I don't really know what it expects...

It might be a TPckgBuf or TPckgC with the value in it though.

you can create one  like this:
Code:
TPckgBuf<TReal64> numbuf(aMyValue);
TPckgC<TReal64> numbuf2(aMyValue);

The first line will mean one extra copying of the data since TPckgBuf has its own buffer, since TPckgC is just a pointer to existing data.

It will store the number in the buffer as raw binary data.
Tue, 2006-12-05 11:45
Joined: 2004-12-27
Forum posts: 15
Re: Set Exif GPS latitude information.
I tried using the method suggested. However, it still gives the same -6 error. I believe there has to be some special syntax for setting the value within the Exif header. From whatever i have read about exif tags, i believe there are 3 bytes used to hold the latitude information within the GPS IFD. 
The problem is how do i convert the information available in TReal64 to fit into those 3 bytes. Also, i 'm not sure if we can directly store the TReal value or we have to convert the value into degrees, minutes and seconds before storing  them.

Anyways i appreciate your help.
Thanks,
Shashi.
Tue, 2008-01-29 16:10
Joined: 2007-03-28
Forum posts: 2
Re: Set Exif GPS latitude information.

Hi Shashi
I know it's a pretty old thread. However, have you found a solution to write EXIF GPS information?
I have exactly the same problem. I'm not able to build the required ETagRational buffer. Any hints?

Thanks
Alex

  • Login to reply to this topic.