OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.91k stars 2.55k forks source link

GTIFF: store bJXLLossless as a bool #11277

Closed andrew-aitchison closed 1 day ago

andrew-aitchison commented 2 days ago

"GTiff: fix type of bJXLLossless

In frmts/gtiff/gt_overview.cpp we were storing a bool as a double, then using it as a bool without a cast.

clang++ warns:

/home/werdna/gdal/git/frmts/gtiff/gt_overview.cpp:1046:26: warning: implicit conversion turns floating-point number into integer: 'const double' to 'bool' [-Wfloat-conversion] 1046 | bJXLLossless ? JXL_LOSSLESS : JXL_LOSSY);

/home/werdna/gdal/git/frmts/gtiff/gt_overview.cpp:1047:62: warning: implicit conversion turns floating-point number into integer: 'const double' to 'bool' [-Wfloat-conversion] 1047 | GTIFFSetJXLLossless(GDALDataset::ToHandle(hODS), bJXLLossless); "

Environment

Provide environment details, if relevant:

rouault commented 1 day ago

cherrry-picked to 3.10 per 45664b22932bd42fb5c8db539757792ff051ec40