[Gdal-dev] Can GDal uses a libtiff.dll and libgeotiff.dll
Steve Brooks
sbrooks2 at kc.rr.com
Tue Jan 14 21:13:51 EST 2003
Frank,
Just to update you on this, I was able to modify the make files to
let GDAL link and use libtiff and geotiff as separate DLLs.
I still had a problem though because I was using tif_win32.c and it
has _TIFFmalloc defined with GlobalAlloc. But, inside GDAL the function
GTIFGetOGISDefn will call GTIFGetGCSInfo which calls the geotiff.dll,
which
will then call _TIFFmalloc and allocate memory with GlobalAlloc.
Then later on in GTIFGetOGISDefn the pszGeogName allocated with
GlobalAlloc
is freed with CPLFree which crashes.
The fix to this was to use malloc, realloc, etc. inside tif_win32.c
Let me know if you are interested in the changes to the make files and
I could make this an option in the Makefile.vc and nmake.opt.
Thanks
Steve Brooks
-----Original Message-----
From: gdal-dev-admin at remotesensing.org
[mailto:gdal-dev-admin at remotesensing.org] On Behalf Of Steve Brooks
Sent: Monday, January 13, 2003 12:44 AM
To: gdal-dev at remotesensing.org
Subject: [Gdal-dev] Can GDal uses a libtiff.dll and libgeotiff.dll
Frank,
I have been trying to add GDal to one of my programs that already was
using libtiff and libgeotiff as DLLs. I'm also trying to integrate the
Kakadu
library to output a geo- reference jp2 file using the driver you wrote
as an example.
I have the jp2 file working without the geo-reference.
Per a previous message stating that the Kakadu library wasn't setup to
support
IWriteBlock, I have been taking parts of the CreateCopy code to do the
geo-reference, i.e.
JP2KAKWriteGeoTIFFInfo( jp2_target jp2_out, GDALDataset *poSrcDS );
Now my input can be one or more images at different scales and
rotations. I already
have this part done, so that it can extract the output image at a
different scale, format,
and rotation.
This is an example of the geotiff reference with (tiepoints), and the
following attributes
GTModelTypeGeoKey = ModelTypeProjected,
GeographicTypeGeoKey example value = 4269,
GeogCitationGeoKey example value = "Iowa South",
ProjectedCSTypeGeoKey example value = 26976,
PCSCitationGeoKey example value = "NAD83",
ProjLinearUnitsGeoKey example value = Linear_Foot
Now since I didn't have the GDALDataset from the input I have been
searching through
GDAL trying to figure out a good way of getting the dataset with the
geotiff reference
above. The easiest way I could see was to create an empty tiff file
with the geotiff in
it and then use GDALOpen on that file.
Well I did this and I ran into problems with having a libtiff dll linked
into my original
project and the libtiff the GDAL has statically linked to the
GDALL11.dll.
In creating the dummy tiff file I have to use TIFFSetField from the
libtiff.dll and
when XTIFFClose is called it tries to free memory that was allocated by
the libtiff.dll
and crashes.
A solution for this problem would be to have gdal11.dll to link with an
external libtiff.dll
and an external geotiff.dll. But, before I tried this I wanted to know
if you knew any
problems before starting this. Also, is this a proper use of gdal in
having different
end developer configurations?
Thanks
Steve Brooks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030114/f498b8d6/attachment.html
More information about the Gdal-dev
mailing list