This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 6b10062195512739fcfcfa841c2e53e2abc80f58 Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Wed Jan 29 15:23:07 2025 +0100 Cleanup (use of existing methods, formatting). --- .../org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java | 9 +++++++-- .../main/org/apache/sis/storage/image/WritableStore.java | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java index 0d8a63650c..edaf1a39fe 100644 --- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java +++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java @@ -150,11 +150,16 @@ public class GeoTiffStoreProvider extends DataStoreProvider { return ProbeResult.INSUFFICIENT_BYTES; } switch (buffer.getShort()) { - case IOBase.LITTLE_ENDIAN: buffer.order(ByteOrder.LITTLE_ENDIAN); // Fall through + case IOBase.LITTLE_ENDIAN: { + buffer.order(ByteOrder.LITTLE_ENDIAN); + // Fall through + } case IOBase.BIG_ENDIAN: { // Default buffer order is big endian. switch (buffer.getShort()) { case IOBase.CLASSIC: - case IOBase.BIG_TIFF: return new ProbeResult(true, MIME_TYPE, VERSION); + case IOBase.BIG_TIFF: { + return new ProbeResult(true, MIME_TYPE, VERSION); + } } } } diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WritableStore.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WritableStore.java index 3a5372a8d7..aa97853d4f 100644 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WritableStore.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/image/WritableStore.java @@ -33,7 +33,6 @@ import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.ImageOutputStream; import org.apache.sis.coverage.grid.GridCoverage; import org.apache.sis.coverage.grid.GridGeometry; -import org.apache.sis.coverage.grid.GridExtent; import org.apache.sis.storage.Resource; import org.apache.sis.storage.GridCoverageResource; import org.apache.sis.storage.WritableAggregate; @@ -211,8 +210,7 @@ class WritableStore extends WorldFileStore { * Make sure that the grid geometry starts at (0,0). * Must be done before to compare with existing grid. */ - final GridExtent extent = gg.getExtent(); - gg = gg.shiftGrid(extent.getLow().getCoordinateValues(), true); + gg = gg.shiftGridToZeros(); /* * If the data store already contains a coverage, then the given grid geometry * must be identical to the existing one, in which case there is nothing to do.