Updated recently

ExtraSamples is left out during TiffImageWriter if ExtraSamples is 0 (zero)
GEOT-6452
Create Flatgeobuf DataStore
GEOT-6451
Update or replace JavaCSV in gt-csv
GEOT-6176
MBTiles + MBStyle: highway shields not shown
GEOT-6450
MBStyles ends up painting little gray icons on missing symbols, mapbox-gl-js does not
GEOT-6448
New vendor option to disable gray mark fallback when no graphic or mark could be loaded
GEOT-6449
CSVDataStoreFactory should be able to create a file if it is not provided
GEOT-6196
MBStyles zoom level rendering activation off by one
GEOT-6447
MBStyles, incorrect translation of symbols conflict resolution
GEOT-6443
Allow to place a text symbolizer Graphic at an offset vs its own label
GEOT-6446
MBStyle: exponential, css, default if null, string transform functions do not implement evaluate(Object), leading to errors
GEOT-6435
App-Schema WFS GetFeature includes namespaces for all workspaces on isolated workspace
GEOT-6425
Error in SQL conversion when function uses a like expression
GEOT-6363
Autowrap and followline options are at the moment incompatible, avoid rendering exceptions
GEOT-6445
App-Schema Cardinality 1..N support for unbounded anonymous sequence children elements
GEOT-6370
Distance Unit is not sent in WFS queries, causing parse problems by many WFS server implementations
GEOT-6444
MBStyles: text-offset is expressed in ems, not pixels
GEOT-6442
MBStyles: halo default color is transparent, not black
GEOT-6441
MBStyles: stack overflow while computing semantic identifiers of a nested "all of all" filter
GEOT-6440
MBStyles: allow for floating point stops
GEOT-6439
MBTiles store, computing the query bounds when not provided is too slow on large files
GEOT-6438
Support hsl/hsla expressions in ColorConverterFactory CSS mode
GEOT-6437
Do not limit simple feature attribute names, right now they can't have ":" inside
GEOT-6436
MBStyle: supports stops for line gaps and text anchors
GEOT-6434
MongoDB CQL_Filter not working anymore
GEOT-5911
AttributeExpressionImpl.evaluate() performance degradatation under concurrency
GEOT-6421
VendorOption markAlongLine - ExernalGraphics for LineSymbolizer
GEOT-6433
issue 1 of 27

ExtraSamples is left out during TiffImageWriter if ExtraSamples is 0 (zero)

Description

We recently upgraded and during regression test we found a difference that causes a file to fail in the workflow.

Our framework has micro services so an image read/rewrite can happen multiple times in a workflow. We have one particular regression test file that has 4 bands (rgb and unspecified). ExtraSamples is set to zero (which is the recommendation if the 4th band has little or nothing to do with alpha). When a rewrite is done with the TiffImageWriter, it drops the zeroed ExtraSamples field completely. Upon rereading, the file fails with "bandOffsets.length is wrong!", which is thrown from the getHRInfo call in GeoTiffReader. But it's really from the java javax.imageio.ImageTypeSpecifier. So the javax class is using a test that conflicts with what the writer assumes was unnecessary.

// javax.imageio.ImageTypeSpecifier

if (bandOffsets.length != numBands) {
throw new IllegalArgumentException
("bandOffsets.length is wrong!");
}

//it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriter

if (numBands > 1 && cm != null && cm.hasAlpha()) {
--numBands;
numExtraSamples = 1;
extraSamples = new char[1];
if (cm.isAlphaPremultiplied()) {
extraSamples[0] = BaselineTIFFTagSet.EXTRA_SAMPLES_ASSOCIATED_ALPHA;
} else {
extraSamples[0] = BaselineTIFFTagSet.EXTRA_SAMPLES_UNASSOCIATED_ALPHA;
}
}

I can't copy over the stack trace but the trace info is:
javax.imageio.ImageTypeSpecifier.java line 286
javax.imageio.ImageTypeSpecifier.createInterLeaved line 399
it.geosolutions.imageio.plugins.tiff.TiffDecompressor.getRawImageTypeSpecifier line 1027
it.geosolutions.imageioimpl.plugins.tiff.TiffImageReader line 1305
org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.setLayout line 1251
org.geotools.gce.geotiff.GeoTiffReader.getHRInfo line 344

Environment

None

Status

Assignee

Unassigned

Reporter

Stacey Acosta

Triage

None

Components

Priority

Medium
Configure