void writeMetadata(int imageNumber) throws IOException { if (file == null) init(); // geokeys all get added at once writeGeoKeys(); // tags gotta be in order Collections.sort(tags); if (imageNumber == 1) { writeHeader(channel); } else { //now this is not the first image we need to fill the Offset of nextIFD channel.position(lastIFD); ByteBuffer buffer = ByteBuffer.allocate(4); if (debugRead) System.out.println("position before writing nextIFD= " + channel.position() + " IFD is " + firstIFD); buffer.putInt(firstIFD); buffer.flip(); channel.write(buffer); } writeIFD(channel, firstIFD); }
void writeMetadata(int imageNumber) throws IOException { if (file == null) init(); // geokeys all get added at once writeGeoKeys(); // tags gotta be in order Collections.sort(tags); if (imageNumber == 1) { writeHeader(channel); } else { //now this is not the first image we need to fill the Offset of nextIFD channel.position(lastIFD); ByteBuffer buffer = ByteBuffer.allocate(4); if (debugRead) System.out.println("position before writing nextIFD= " + channel.position() + " IFD is " + firstIFD); buffer.putInt(firstIFD); buffer.flip(); channel.write(buffer); } writeIFD(channel, firstIFD); }
void writeMetadata(int imageNumber) throws IOException { if (file == null) init(); // geokeys all get added at once writeGeoKeys(); // tags gotta be in order Collections.sort(tags); int start = 0; if (imageNumber == 1) start = writeHeader(channel); else { //now this is not the first image we need to fill the Offset of nextIFD channel.position(lastIFD); ByteBuffer buffer = ByteBuffer.allocate(4); if (debugRead) System.out.println("position before writing nextIFD= " + channel.position() + " IFD is " + firstIFD); buffer.putInt(firstIFD); buffer.flip(); channel.write(buffer); } writeIFD(channel, firstIFD); }