Hi,
I improved the interface for Pascal users to support dynamic linking/loading now. With this the DLLs don't have to be loaded from the start of program execution, which unnecessarily consumes memory. Also you can now point to where the DLLs reside and which filename they have. Full unicode support. Also with checks against loading errors.
Based on SDK version 3.11.
All files changed are included in the attachment. Since all the help files and code comments tell me to send changes to the forum instead of a single person I hereby create this topic.
Cheers.
Delphi interface (+ example) improved
Moderators: XnTriq, helmut, xnview
-
- Posts: 33
- Joined: Tue Mar 09, 2010 6:40 pm
Delphi interface (+ example) improved
You do not have the required permissions to view the files attached to this post.
-
- Author of XnView
- Posts: 44922
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: Delphi interface (+ example) improved
Hello,
There are some errors in libgfl.pas:
Also be added in EXIF2:
and
Regards...
Miguel Angel
http://imagen3d.site88.net
There are some errors in libgfl.pas:
Code: Select all
function gflSetColorAt(src: PGFL_BITMAP; x, y: GFL_INT32; var color: TGFL_COLOR): GFL_ERROR; stdcall;
GFL_EXIF_MAIN_IFD = $0002;
GFL_EXIF_IFD_0 = $0001;
function gflBitblt(src: PGFL_BITMAP; rect: PGFL_RECT;dst: PGFL_BITMAP; x_dest, y_dest: GFL_INT32): GFL_ERROR; stdcall;
Code: Select all
procedure gflBitmapSetEXIFValueRationalArray2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; const pq: PGFL_UINT32; count: GFL_INT32); stdcall;
Code: Select all
procedure gflBitmapSetEXIFValueRationalArray2; external GflDLL;
Miguel Angel
http://imagen3d.site88.net
-
- Posts: 33
- Joined: Tue Mar 09, 2010 6:40 pm
Re: Delphi interface (+ example) improved
Now that you point to it... the implementation should be
...along with the ...Ex()-functions the same in/out-definitions. But I never worked with them, so I cannot really test it. However, handing over a full color as last parameter instead of a pointer to a color should have been a mistake all along. But I'm gonna investigate if this (my) definition is a more straight translation off the .h.
GFL_EXIF_MAIN_IFD and GFL_EXIF_IFD_0 have been spotted right
Also not sure if gflBitblt should not be defined as...because of dst being altered. But good eye on that parameter anyway
Good point in finding out that gflBitmapSetEXIFValueRationalArray2 is also not defined until today. Totally agree with your translation. In the meantime I also found out that gflGetExtraInfos and gflGetExtraInfosCount are not defined, but did that by now (see Thread). When I have all clarifications done I will post a second update. That will also include an improved method for dynamic linking to incorporate the loading of PlugIns also.
So thx along, Miguel
Code: Select all
function gflGetColorAt( const src: PGFL_BITMAP; x, y: GFL_INT32; var color: PGFL_COLOR ): GFL_ERROR; stdcall;
function gflSetColorAt( var dst: PGFL_BITMAP; x, y: GFL_INT32; const color: PGFL_COLOR ): GFL_ERROR; stdcall;
GFL_EXIF_MAIN_IFD and GFL_EXIF_IFD_0 have been spotted right
Also not sure if gflBitblt should not be defined as
Code: Select all
function gflBitblt( src: PGFL_BITMAP; rect: PGFL_RECT; var dst: PGFL_BITMAP; x_dest, y_dest: GFL_INT32 ): GFL_ERROR; stdcall;
Good point in finding out that gflBitmapSetEXIFValueRationalArray2 is also not defined until today. Totally agree with your translation. In the meantime I also found out that gflGetExtraInfos and gflGetExtraInfosCount are not defined, but did that by now (see Thread). When I have all clarifications done I will post a second update. That will also include an improved method for dynamic linking to incorporate the loading of PlugIns also.
So thx along, Miguel
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: Delphi interface (+ example) improved
Hi,
you're right. The function gflBitmapSetEXIFValueRationalArray2 is not implemented in version 3.11.
Frankly, my level of programming in Delphi is low, as my English level.
I hope this new version of the interface for delphi.
Thanks and regards ...
Miguel Angel
you're right. The function gflBitmapSetEXIFValueRationalArray2 is not implemented in version 3.11.
Frankly, my level of programming in Delphi is low, as my English level.
I hope this new version of the interface for delphi.
Thanks and regards ...
Miguel Angel
-
- Posts: 33
- Joined: Tue Mar 09, 2010 6:40 pm
Re: Delphi interface (+ example) improved - 2nd version
This second update has completely checked and reviewed the whole interface and the demo example.
- Reordered all definitions to the same order in the .h-files. This way future additions and corrections can be found much easier.
- Changed many function parameters to use VAR instead of pointers, where it makes sense.
- "gflSepiaEx" is now properly linked (was misspelled).
- Removed "gflBitmapSetEXIFThumbnail" and "gflGetDefaultPreviewParams" as they don't exist at all in current DLLs.
- Added functions "gflGetExtraInfosCount", "gflGetExtraInfos", "gflBitmapGetEXIFValue" and "gflBitmapSetEXIFValueRationalArray2" (thanks to mediazg for pointing out last one).
- Added ability to exit, unlink and unload the GFL. This makes sense when you want to re-initialize the whole GFL because of errors or exceptions.
- Enhanced "gfl_LoadLib" to now also accept a path to plugins. With this, they're also loaded when dynamically linking the GFL. This is also included in the demo now.
- Enhanced demo to list picture properties along with EXIF data, IPTC data, ICC profile header, Extra infos (TIFF) and trying to list XMP data (see other thread). Also tweaked some code in "FormatInfo_Form" and both window surfaces including controls. The Open-dialog now filters all supported file extensions at once instead of just listing all files initially.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: Delphi interface (+ example) improved
Hi,
Regards...
Miguel Angel
This version has many changes from previous version. Such changes require modifying a lot of code in programs and that is a problem.Changed many function parameters to use VAR instead of pointers, where it makes sense
Regards...
Miguel Angel
-
- Posts: 33
- Joined: Tue Mar 09, 2010 6:40 pm
Re: Delphi interface (+ example) improved
Hi Miguel,
I know exactly what you mean and somehow expected such a reaction. So I included another compiler switch {$COMPATIBLE311} which supports nearly all of the old definitions. Not all, because a handful of them were wrong and should not be used anymore. Or I also fixed them and you simply have to change one or two parameters.
If you encounter compiling errors and are not sure on how to solve them, here are two easy rules which have most chances of being encountered:
Don't hesitate to name other issues. Or wishes.
Oh - one question: how much of GFL do you use, Miguel? My usage so far has not gone beyond what I extended the demo example to: loading a file and getting most of its properties. I'm not into modifying or even drawing on them.
I know exactly what you mean and somehow expected such a reaction. So I included another compiler switch {$COMPATIBLE311} which supports nearly all of the old definitions. Not all, because a handful of them were wrong and should not be used anymore. Or I also fixed them and you simply have to change one or two parameters.
If you encounter compiling errors and are not sure on how to solve them, here are two easy rules which have most chances of being encountered:
- Error: "Types of actual and formal var parameters must be identical"
Solution: either change @variable to variable or variable to variable^. - Error: "Incompatible types: SOMETHING and PSOMETHING"
Solution: either change variable^ to variable or variable to @variable.
Don't hesitate to name other issues. Or wishes.
Oh - one question: how much of GFL do you use, Miguel? My usage so far has not gone beyond what I extended the demo example to: loading a file and getting most of its properties. I'm not into modifying or even drawing on them.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: Delphi interface (+ example) improved
I use GFL for about 2 years
I am an amateur photographer stereo and I'm developing a program called Imagen3D:
http://imagen3d.site88.net
I'll try this new version and I will indicate to you the results of my tests.
Miguel Angel
I am an amateur photographer stereo and I'm developing a program called Imagen3D:
http://imagen3d.site88.net
I'll try this new version and I will indicate to you the results of my tests.
Miguel Angel
-
- Posts: 8
- Joined: Mon Mar 22, 2010 11:23 am
Re: Delphi interface (+ example) improved
Hi
Whhen i compil the DPR with Delphi7 and opening Nikon D200 NEF file i get error like
FR - "Opération en virgule flottante incorrecte"
EN - "Floating-point operation error"
No pb with Nikon jpeg file format.
I need help for opening Nikon RAW format
Whhen i compil the DPR with Delphi7 and opening Nikon D200 NEF file i get error like
FR - "Opération en virgule flottante incorrecte"
EN - "Floating-point operation error"
No pb with Nikon jpeg file format.
I need help for opening Nikon RAW format