Hello,
Can you explain me with an example How the function is used to store GPS data?
For example, the latitude 28º 26' 59.55", Can you tell me how to be added to the EXIF information of the picture?
Regards...
Miguel Angel
http://imagen3d.site88.net
gflBitmapSetEXIFValueRationalArray2
Moderators: XnTriq, helmut, xnview
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
-
- Posts: 72
- Joined: Thu Nov 08, 2007 9:22 am
Re: gflBitmapSetEXIFValueRationalArray2
Hi Madiazg,
I test it this morning for you. With C++Builder, you can test this, work for me :
You can complete the GPS tag following this link : http://www.sno.phy.queensu.ca/~phil/exi ... s/GPS.html
I test it this morning for you. With C++Builder, you can test this, work for me :
Code: Select all
// Lib init
gflLibraryInit();
// Filenames
AnsiString lFileName = "_MG_5209.JPG";
AnsiString lDestFileName = "_MG_5209_TRT.JPG";
// Load & Save structures
GFL_FORMAT_INFORMATION mFormatInfo;
GFL_FILE_INFORMATION lInformation;
GFL_LOAD_PARAMS mLoadOption;
GFL_SAVE_PARAMS mSaveOption;
GFL_BITMAP* mOriBitmap;
GFL_EXIF_DATAEX* mEXIFData2;
gflGetDefaultLoadParams( &mLoadOption );
mLoadOption.Flags |= GFL_LOAD_READ_ALL_COMMENT;
mLoadOption.Flags |= GFL_LOAD_METADATA;
mLoadOption.Flags |= GFL_LOAD_COMMENT;
GFL_ERROR mError = gflLoadBitmap(lFileName.c_str(), &mOriBitmap, &mLoadOption, &lInformation);
// Getting EXIF data from the source file
mEXIFData2 = gflBitmapGetEXIF2(mOriBitmap);
// Adding some GPS Data
char lLat[2];
memset(lLat, 2, 0);
lLat[0] = 'N';
gflBitmapSetEXIFValueString2(mEXIFData2, GFL_EXIF_GPS_IFD, 0x0001, lLat);
GFL_UINT32 lpPQ[6];
lpPQ[0] = 28; lpPQ[1] = 1;
lpPQ[2] = 26; lpPQ[3] = 1;
lpPQ[4] = 119; lpPQ[5] = 2;
gflBitmapSetEXIFValueRationalArray2(mEXIFData2, GFL_EXIF_GPS_IFD, 0x0002, lpPQ, 3);
// Removing all metadata from the GFL_BITMAP
// And adding the new EXIF data
gflBitmapRemoveMetaData(mOriBitmap);
gflBitmapSetEXIF2(mOriBitmap, mEXIFData2);
// Save file
gflGetDefaultSaveParams(&mSaveOption);
mSaveOption.Flags = GFL_SAVE_REPLACE_EXTENSION | GFL_SAVE_ICC_PROFILE;
mSaveOption.FormatIndex = 0;
mSaveOption.Quality = 50;
gflSaveBitmap(lDestFileName.c_str(), mOriBitmap, &mSaveOption);
// Free ressources
gflFreeFileInformation(&lInformation);
gflFreeBitmap(mOriBitmap);
gflFreeEXIF2(mEXIFData2);
gflLibraryExit();
Dom
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: gflBitmapSetEXIFValueRationalArray2
Thank you very much Dominique.
The code works correctly.
In Delphi:
In Libgfl.pas:
Regards...
Miguel Angel
http://imagen3d.site88.net
The code works correctly.
In Delphi:
Code: Select all
var
pq: array[0..5] of integer;
...
begin
...
pq[0] := 28; pq[1] := 1;
pq[2] := 26; pq[3] := 1;
pq[4] := 119; pq[5] := 2;
gflBitmapSetEXIFValueRationalArray2(EXIF2,GFL_EXIF_GPS_IFD,2,@pq,3);
...
end;
Code: Select all
procedure gflBitmapSetEXIFValueRationalArray2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; const pq: PGFL_UINT32; count: GFL_INT32); stdcall;
...
procedure gflBitmapSetEXIFValueRationalArray2; external GflDLL;
Miguel Angel
http://imagen3d.site88.net
-
- Posts: 2
- Joined: Wed Sep 30, 2009 2:03 pm
Re: gflBitmapSetEXIFValueRationalArray2
Hi.
Unlike JPG, for format TIFF this code does not work. After file saving, in it metadata there is only this line: "LIBFORMAT (c) Pierre-e Gougelet".
What to do?
Win XP Pro SP3, CodeGear RAD Studio 2007 (CBuilder), GFL SDK v3.11 (I use libgfl.lib created from libgfl311.dll by implib.exe)
Unlike JPG, for format TIFF this code does not work. After file saving, in it metadata there is only this line: "LIBFORMAT (c) Pierre-e Gougelet".
What to do?
Win XP Pro SP3, CodeGear RAD Studio 2007 (CBuilder), GFL SDK v3.11 (I use libgfl.lib created from libgfl311.dll by implib.exe)
-
- Author of XnView
- Posts: 44885
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: gflBitmapSetEXIFValueRationalArray2
You can only edit exif on jpegDoga wrote: Unlike JPG, for format TIFF this code does not work. After file saving, in it metadata there is only this line: "LIBFORMAT (c) Pierre-e Gougelet".
Pierre.
-
- Posts: 2
- Joined: Wed Sep 30, 2009 2:03 pm
Re: gflBitmapSetEXIFValueRationalArray2
Badly.When this possibility for format TIFF will be added?