IPTC & EXIF in VB

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
Edgardo
Posts: 4
Joined: Mon Dec 07, 2009 9:44 pm

IPTC & EXIF in VB

Post by Edgardo » Fri Dec 25, 2009 10:46 pm

Hi,

Any way of just reading IPTC (and eventually EXIF) info using GFLSDK?

I saw that it's possible in GflAx, so it should be posible in VB, I guess. But I don't want to mix both libraries: instead I want to achieve this using only GFLSDK.

I saw elsewhere in this forum that there's at least one guy who is able to read IPTC & EXIF using GFLSDK, but I didn't get an answer yet. Anyone else can help?

Thanks!

User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

Re: IPTC & EXIF in VB

Post by dominique » Wed Dec 30, 2009 9:49 am

Hi,
You have information about metadata function in the wiki of GFLSDK, follow the link bellow:
http://www.xnview.com/wiki/index.php5?title=GFL_SDK
Dom

Edgardo
Posts: 4
Joined: Mon Dec 07, 2009 9:44 pm

Re: IPTC & EXIF in VB

Post by Edgardo » Wed Dec 30, 2009 2:18 pm

Hi dominique,
Hi,
You have information about metadata function in the wiki of GFLSDK, follow the link bellow:
http://www.xnview.com/wiki/index.php5?title=GFL_SDK
Thanks for your reply.

I've already seen that info. The problem is how to translate IPTC structures to VB. For instance, the GFL_IPTC_DATA structure is NOT defined in GFLlib.bas (or elsewhere in the GFLSDK installed files). I've seen replies from Pierre about having trouble defining this structure and others for EXIF in VB. The only visible function that seems to retrieve IPTC data is gflBitmapGetIPTCValue, which is DECLAREd in VB as follows (there's no mention to it in GFLSDK wiki):

Public Declare Function gflBitmapGetIPTCValue Lib "libgfl290.dll" (ByRef src As GFL_BITMAP, ByVal id As Long, ByVal Name As String, ByVal value_length As Long) As Integer

(I'm currently using 2.90; in 3.11 there seems to be no changes with respect to that).

Since it has no explanation in the help file that comes with GFLSDK, I assume that the integer this function returns is just an error code; given the fact that the only parameter passed by reference is the bitmap (ByRef src As GFL_BITMAP), it seems that IPTC info is returned inside a member of the GFL_BITMAP struct. There is only one member related to metadata (MetaData As Long). If this is it, it's a pointer to something I don't know how to retrieve.

In the wiki there's a function gflLoadIPTC, which is NOT declared in VB nor its related structures.

Sorry for this long explanation, but I want to be as clear as possible. Hope that helps.

Have I nice year,

Edgardo.

Edgardo
Posts: 4
Joined: Mon Dec 07, 2009 9:44 pm

Re: IPTC & EXIF in VB

Post by Edgardo » Thu Jan 07, 2010 3:53 pm

Hi everyone,

Finally I found a solution to this. I've added the following declarations:

Code: Select all

' Added declarations for IPTC
Public Declare Function gflSetIPTCValue Lib "libgfl290.dll" (ByVal IPTC_Data As Long, ByVal ID As Long, ByVal Value As String) As Long

Public Declare Function gflBitmapHasIPTC Lib "libgfl290.dll" (ByRef src As GFL_BITMAP) As Long
Public Declare Function gflBitmapGetIPTC Lib "libgfl290.dll" (ByRef src As GFL_BITMAP) As Long
Public Declare Function gflBitmapSetIPTC Lib "libgfl290.dll" (ByRef src As GFL_BITMAP, ByVal IPTCData As Long) As Long
Public Declare Sub gflFreeIPTC Lib "libgfl290.dll" (ByVal IPTCData As Long)

Public Type GFL_IPTC_ENTRY
    ID As Long
    Name As Long
    Value As Long
End Type

Public Type GFL_IPTC_DATA
    NumberOfItems As Long
    ItemsList As Long
End Type

' End additions
String values such as Name and Value from GFL_IPTC_ENTRY must be taken using extGetStr.
I will try to make the same for EXIF.

Regards

Post Reply