mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
Add a unit test
This commit is contained in:
parent
6501321fac
commit
adda52053b
@ -57,6 +57,7 @@ import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
@ -1014,4 +1015,15 @@ public class TIFFImageReaderTest extends ImageReaderAbstractTest<TIFFImageReader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadRasterColorNormalization() throws IOException {
|
||||
ImageReader reader = createReader();
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getClassLoaderResource("/tiff/ycbcr-cat.tif"))) {
|
||||
reader.setInput(stream);
|
||||
Raster rawRaster = reader.readRaster(0, null);
|
||||
Raster normalizedRaster = reader.read(0, null).getRaster();
|
||||
assertNotEquals(rawRaster.getSample(10, 10, 0), normalizedRaster.getSample(10, 10, 0), 0.0001f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user