Skip to content

Commit 05b8034

Browse files
author
ptah
committed
Fixed wrong count of geo keys in GeotiffWriter
1 parent d988494 commit 05b8034

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gov/nasa/worldwind/formats/tiff/GeotiffWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ private void writeGeographicImageGeoKeys(ArrayList<TiffIFDEntry> ifds, AVList pa
925925
};
926926

927927
// IMPORTANT!! update count - number of geokeys
928-
values[3] = (short) (values.length / 4);
928+
values[3] = (short) ((values.length - 4) / 4);
929929

930930
byte[] bytes = this.getBytes(values);
931931
this.theChannel.write(ByteBuffer.wrap(bytes));
@@ -983,7 +983,7 @@ private void writeGeographicElevationGeoKeys(ArrayList<TiffIFDEntry> ifds, AVLis
983983
};
984984

985985
// IMPORTANT!! update count - number of geokeys
986-
values[3] = (short) (values.length / 4);
986+
values[3] = (short) ((values.length - 4) / 4);
987987

988988
byte[] bytes = this.getBytes(values);
989989
this.theChannel.write(ByteBuffer.wrap(bytes));

0 commit comments

Comments
 (0)