Use non-deprecated GDALGetDataTypeSizeBits() function

This commit is contained in:
Even Rouault 2025-09-23 12:50:52 +02:00 committed by Andrea Giudiceandrea
parent f3dc5f274c
commit 4a31c5af9b

View File

@ -4205,7 +4205,7 @@ QString QgsGdalProvider::validateCreationOptions( const QStringList &creationOpt
{ {
QString value = optionsMap.value( QStringLiteral( "PREDICTOR" ) ); QString value = optionsMap.value( QStringLiteral( "PREDICTOR" ) );
GDALDataType nDataType = ( !mGdalDataType.isEmpty() ) ? ( GDALDataType ) mGdalDataType.at( 0 ) : GDT_Unknown; GDALDataType nDataType = ( !mGdalDataType.isEmpty() ) ? ( GDALDataType ) mGdalDataType.at( 0 ) : GDT_Unknown;
int nBitsPerSample = nDataType != GDT_Unknown ? GDALGetDataTypeSize( nDataType ) : 0; const int nBitsPerSample = nDataType != GDT_Unknown ? GDALGetDataTypeSizeBits( nDataType ) : 0;
QgsDebugMsgLevel( QStringLiteral( "PREDICTOR: %1 nbits: %2 type: %3" ).arg( value ).arg( nBitsPerSample ).arg( ( GDALDataType ) mGdalDataType.at( 0 ) ), 2 ); QgsDebugMsgLevel( QStringLiteral( "PREDICTOR: %1 nbits: %2 type: %3" ).arg( value ).arg( nBitsPerSample ).arg( ( GDALDataType ) mGdalDataType.at( 0 ) ), 2 );
// PREDICTOR=2 only valid for 8/16/32 bits per sample // PREDICTOR=2 only valid for 8/16/32 bits per sample
// TODO check for NBITS option (see geotiff.cpp) // TODO check for NBITS option (see geotiff.cpp)