Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JDK11 cross compilation #3435

Merged
merged 4 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class RenderPngTests extends AnyFunSuite with Matchers with TileBuilders with Ra
val stops = Array(10000, 20000, 30000, 40000, 50000, 60000, 70000)
val colorMap = ColorMap(stops, ramp)

val greyPng = colorMap.render(tile).map(z => z >> 8 & 0xFF).renderPng(GreyPngEncoding(0x00))
val greyPng = colorMap.render(tile).map(z => z >> 8 & 0xFF).renderPng(GreyPngEncoding)
Copy link
Member Author

@pomadchin pomadchin Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question why it worked, technically it was written as an greya image with colorType set to 0 in header that could be considered by some readers as grey (header) and by others as greya (header + the data structure).

JDK 11 ImageIO added some heuristics to convert grey into greya based on the actual data written not only based on the header info ¯\_(ツ)_/¯

val greyaPng = colorMap.render(tile).map(z => (z & 0xFF00) | 0xFF).renderPng(GreyaPngEncoding)

val greyImg = ImageIO.read(new ByteArrayInputStream(greyPng))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ class ReprojectSpec extends AnyFunSpec
val raster = geoTiff.raster.reproject(geoTiff.crs, WebMercator)

geoTiff.crs.toProj4String should be ("+proj=cea +lat_ts=33.75 +lon_0=-117.333333333333 +x_0=0.0 +y_0=0.0 +datum=NAD27 +units=m ")
raster.extent should be (Extent(-1.3095719172012957E7, 3983866.9277966353, -1.305868719072902E7, 4021260.5495227976))

// raster.extent should be (Extent(-1.3095719172012957E7, 3983866.9277966353, -1.305868719072902E7, 4021260.5495227976))
raster.extent.xmin should be (-1.3095719172012957E7 +- 1e-7)
raster.extent.ymin should be (3983866.9277966353 +- 1e-7)
raster.extent.xmax should be (-1.305868719072902E7 +- 1e-7)
raster.extent.ymax should be (4021260.5495227976 +- 1e-7)

raster.dimensions shouldBe Dimensions(512, 517)
}
}
Expand Down