[Gdal-dev] GDALWarp Gif Problems

Frank Warmerdam warmerdam at pobox.com
Mon Jan 22 23:59:25 EST 2007


Chris Portka wrote:
> I can't seem to get GDAL warp to work on a gif image when converting 
> from one UTM zone to another.  If anyone could give me any help at all 
> that would be much appreciated.  I've worked on this a long time and 
> can't find any documentation that shows I'm doing anything incorrect.  
> The exception I get is in this part of the GDAL code (my code follows):
> 
> int GDALGenImgProjTransform( void *pTransformArg, int bDstToSrc,
>                             int nPointCount,
>                             double *padfX, double *padfY, double *padfZ,
>                             int *panSuccess )
> {
>    GDALGenImgProjTransformInfo *psInfo =
>        (GDALGenImgProjTransformInfo *) pTransformArg;
>    int   i;
>    double *padfGeoTransform;
>    void *pGCPTransformArg;
>    void *pRPCTransformArg;
>    void *pTPSTransformArg;
>    void *pGeoLocTransformArg;
> 
>    if( bDstToSrc )
>    {
>        padfGeoTransform = psInfo->adfDstGeoTransform;
>        pGCPTransformArg = psInfo->pDstGCPTransformArg;
>        pRPCTransformArg = NULL;
>        pTPSTransformArg = NULL;
>        pGeoLocTransformArg = NULL;
>    }
>    else
>    {
>        padfGeoTransform = psInfo->adfSrcGeoTransform;
>        pGCPTransformArg = psInfo->pSrcGCPTransformArg;    
> <-----EXCEPTION HERE

Chris,

Your code looks ok to me.  It might help to have a gdalinfo report on the
input file to see if it has GCPs.

But if I where you, I'd examine the psInfo structure very carefully in
the debugger to see if there is anything peculiar about it.

If you have no luck, feel free to boil this down to a minimal program,
and submit a bug report with the input file or a small variation that
demonstrates the problem.

By the way, the GIF format is a "CreateCopy" format so you won't be
able to do a warp directly to a gif file.  You will need to do it
to an intermediate file in a randomly writable format, and then
use CreateCopy() from that to produce the GIF file.  The intermediate
file could be in memory (using MEM format driver) if you know you
aren't working with particularly large images.  However, assuming your
report of where the problem is manifesting is correct, I can't see
that this has anything to do with your current problem.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list