diff --git a/src/gmt_gdalcall.c b/src/gmt_gdalcall.c index f677d534e7c..6a6f729b984 100644 --- a/src/gmt_gdalcall.c +++ b/src/gmt_gdalcall.c @@ -184,7 +184,7 @@ GMT_LOCAL int save_grid_with_GMT(struct GMT_CTRL *GMT, GDALDatasetH hDstDS, stru GDALRasterBandH hBand; hBand = GDALGetRasterBand(hDstDS, 1); - nPixelSize = GDALGetDataTypeSize(GDALGetRasterDataType(hBand)) / 8; /* /8 because return value is in BITS */ + nPixelSize = GDALGetDataTypeSizeBytes(GDALGetRasterDataType(hBand)); nXSize = GDALGetRasterXSize(hDstDS); nYSize = GDALGetRasterYSize(hDstDS); diff --git a/src/gmt_gdalread.c b/src/gmt_gdalread.c index 5561c7f683a..6ca09d1f534 100644 --- a/src/gmt_gdalread.c +++ b/src/gmt_gdalread.c @@ -1041,7 +1041,7 @@ int gmt_gdalread (struct GMT_CTRL *GMT, char *gdal_filename, struct GMT_GDALREAD /* The following assumes that all bands have the same PixelSize, data type. Otherwise ... */ hBand = GDALGetRasterBand(hDataset, first_layer); - nPixelSize = GDALGetDataTypeSize(GDALGetRasterDataType(hBand)) / 8; /* /8 because return value is in BITS */ + nPixelSize = GDALGetDataTypeSizeBytes(GDALGetRasterDataType(hBand)); if (jump) { nBufXSize[0] = XDim / jump;