You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR 1: output.tif: PREDICTOR=2 is only supported with 8/16/32/64 bit samples.
I think any Sentinel-2 S2MSI2A product from Copernicus will reproduce the error message. After running gdalinfo on the image and noticing that the band was UInt16, I'm guessing it's the second to last line that is the issue:
I was trying to measure how much difference the predictor makes, so the main issue is that I found the error message confusing. It would be nice if the error message included the 15 bits part (or is it something else causing the error message?) since the band is UInt16 and I assumed that was a 16 bit sample.
Heading into speculation: I'm also curious if it's technically possible to pad the 15 data bits with a 0 or 1 in the MSB of a 16 bit sample, and use the predictor on that.
Steps to reproduce the issue
Run gdal_translate -of COG -co COMPRESS=ZSTD -co PREDICTOR=YES S2A_MSIL2A_20230309T105851_N0509_R094_T31UEB_20230309T184503.SAFE/GRANULE/L2A_T31UEB_A040274_20230309T110129/IMG_DATA/R10m/T31UEB_20230309T105851_B03_10m.jp2 output.tif. but I believe any recent Sentinel-2 S2MSI2A product should give the same behavior.
Versions and provenance
GDAL 3.10.0 docker image.
Additional context
No response
The text was updated successfully, but these errors were encountered:
rouault
added a commit
to rouault/gdal
that referenced
this issue
Dec 8, 2024
Heading into speculation: I'm also curious if it's technically possible to pad the 15 data bits with a 0 or 1 in the MSB of a 16 bit sample, and use the predictor on that.
That's what NBITS=16 will do, but that takes a bit more storage space. In theory doing horizontal differenciation on non power-of-two BitsPerSample value should be possible (the TIFF spec itself mentions that as a possibility), but if that got implemented in libtiff, that would cause backwards compatibility issue with older libtiff-based implementations that couldn't read such files.
What is the bug?
Running
gdal_translate -of COG -co COMPRESS=ZSTD -co PREDICTOR=YES S2A_MSIL2A_20230309T105851_N0509_R094_T31UEB_20230309T184503.SAFE/GRANULE/L2A_T31UEB_A040274_20230309T110129/IMG_DATA/R10m/T31UEB_20230309T105851_B03_10m.jp2 output.tif
gives the error message:I think any Sentinel-2 S2MSI2A product from Copernicus will reproduce the error message. After running gdalinfo on the image and noticing that the band was UInt16, I'm guessing it's the second to last line that is the issue:
I was trying to measure how much difference the predictor makes, so the main issue is that I found the error message confusing. It would be nice if the error message included the 15 bits part (or is it something else causing the error message?) since the band is UInt16 and I assumed that was a 16 bit sample.
Heading into speculation: I'm also curious if it's technically possible to pad the 15 data bits with a 0 or 1 in the MSB of a 16 bit sample, and use the predictor on that.
Steps to reproduce the issue
Run
gdal_translate -of COG -co COMPRESS=ZSTD -co PREDICTOR=YES S2A_MSIL2A_20230309T105851_N0509_R094_T31UEB_20230309T184503.SAFE/GRANULE/L2A_T31UEB_A040274_20230309T110129/IMG_DATA/R10m/T31UEB_20230309T105851_B03_10m.jp2 output.tif
. but I believe any recent Sentinel-2 S2MSI2A product should give the same behavior.Versions and provenance
GDAL 3.10.0 docker image.
Additional context
No response
The text was updated successfully, but these errors were encountered: