"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "geo_get.c" between
libgeotiff-1.5.1.tar.gz and libgeotiff-1.6.0.tar.gz

About: libgeotiff is a library (built on top of libtiff) for reading and writing coordinate system information from and to GeoTIFF files (GeoTIFF establishes a TIFF based interchange format for georeferenced raster imagery).

geo_get.c  (libgeotiff-1.5.1):geo_get.c  (libgeotiff-1.6.0)
skipping to change at line 176 skipping to change at line 176
if (count==1 && type==TYPE_SHORT) data = (char *)&key->gk_data; if (count==1 && type==TYPE_SHORT) data = (char *)&key->gk_data;
else data = key->gk_data; else data = key->gk_data;
_GTIFmemcpy( val, data + nIndex*size, count*size ); _GTIFmemcpy( val, data + nIndex*size, count*size );
if (type==TYPE_ASCII) if (type==TYPE_ASCII)
((char *)val)[count-1] = '\0'; /* replace last char with NULL */ ((char *)val)[count-1] = '\0'; /* replace last char with NULL */
return count; return count;
} }
/************************************************************************/
/* GTIFKeyGetInternal() */
/************************************************************************/
static int GTIFKeyGetInternal( GTIF *psGTIF, geokey_t key,
void* pData,
int nIndex,
int nCount,
tagtype_t expected_tagtype )
{
tagtype_t tagtype;
if( !GTIFKeyInfo(psGTIF, key, NULL, &tagtype) )
return 0;
if( tagtype != expected_tagtype )
{
if( psGTIF->gt_error_callback )
{
psGTIF->gt_error_callback(
psGTIF,
LIBGEOTIFF_WARNING,
"Expected key %s to be of type %s. Got %s",
GTIFKeyName(key), GTIFTypeName(expected_tagtype),
GTIFTypeName(tagtype));
}
return 0;
}
return GTIFKeyGet( psGTIF, key, pData, nIndex, nCount );
}
/************************************************************************/
/* GTIFKeyGetASCII() */
/************************************************************************/
/**
* This function reads the value of a single GeoKey of type ASCII from a GeoTIFF
file.
*
* Same as GTIFGetKey() except that it adds checking that the key read is of the
* expected type.
*/
int GTIFKeyGetASCII( GTIF *gtif, geokey_t key, char* szStr, int szStrMaxLen )
{
return GTIFKeyGetInternal( gtif, key, szStr, 0, szStrMaxLen, TYPE_ASCII );
}
/************************************************************************/
/* GTIFKeyGetSHORT() */
/************************************************************************/
/**
* This function reads the value of a single GeoKey of type SHORT from a GeoTIFF
file.
*
* Same as GTIFGetKey() except that it adds checking that the key read is of the
* expected type.
*/
int GTIFKeyGetSHORT( GTIF *gtif, geokey_t key, unsigned short* pnVal, int nIndex
,
int nCount )
{
return GTIFKeyGetInternal(gtif, key, pnVal, nIndex, nCount, TYPE_SHORT);
}
/************************************************************************/
/* GDALGTIFKeyGetDOUBLE() */
/************************************************************************/
/**
* This function reads the value of a single GeoKey of type DOUBLE from a GeoTIF
F file.
*
* Same as GTIFGetKey() except that it adds checking that the key read is of the
* expected type.
*/
int GTIFKeyGetDOUBLE( GTIF *gtif, geokey_t key, double* pdfVal, int nIndex,
int nCount )
{
return GTIFKeyGetInternal(gtif, key, pdfVal, nIndex, nCount, TYPE_DOUBLE);
}
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)