Skip to content

Commit

Permalink
Merge pull request #11458 from rouault/fix_11457
Browse files Browse the repository at this point in the history
GTiff/COG writer: add hint about NBITS creation option to specify to …
  • Loading branch information
rouault authored Dec 9, 2024
2 parents dca3b3e + a14b7be commit 16da110
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frmts/gtiff/gtiffdataset_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5323,15 +5323,23 @@ TIFF *GTiffDataset::CreateLL(const char *pszFilename, int nXSize, int nYSize,
else
#endif
{
const int nBITSHint = (l_nBitsPerSample < 8) ? 8
: (l_nBitsPerSample < 16) ? 16
: (l_nBitsPerSample < 32) ? 32
: 64;
ReportError(pszFilename, CE_Failure, CPLE_AppDefined,
#ifdef HAVE_PREDICTOR_2_FOR_64BIT
"PREDICTOR=2 is only supported with 8/16/32/64 "
"bit samples."
"bit samples. You can specify the NBITS=%d "
"creation option to promote to the closest "
"supported bits per sample value.",
#else
"PREDICTOR=2 is only supported with 8/16/32 "
"bit samples."
"bit samples. You can specify the NBITS=%d "
"creation option to promote to the closest "
"supported bits per sample value.",
#endif
);
nBITSHint);
}
return nullptr;
}
Expand Down

0 comments on commit 16da110

Please sign in to comment.