Set Exif GPS latitude information.
| Mon, 2006-12-04 11:22 | |
|
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. |
|






Forum posts: 1156
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.
There is an AppendFormat too.
Forum posts: 15
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).
Forum posts: 1156
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:
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.
Forum posts: 15
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.
Forum posts: 2
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