mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-10-04 11:26:44 -04:00
Move setByteOrder to DDSImageReader.readHeader
This commit is contained in:
@@ -25,9 +25,7 @@ final class DDSHeader {
|
|||||||
|
|
||||||
public static DDSHeader read(final ImageInputStream imageInput) throws IOException {
|
public static DDSHeader read(final ImageInputStream imageInput) throws IOException {
|
||||||
DDSHeader header = new DDSHeader();
|
DDSHeader header = new DDSHeader();
|
||||||
|
|
||||||
imageInput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
|
||||||
|
|
||||||
// Read MAGIC bytes [0,3]
|
// Read MAGIC bytes [0,3]
|
||||||
byte[] magic = new byte[DDS.MAGIC.length];
|
byte[] magic = new byte[DDS.MAGIC.length];
|
||||||
imageInput.readFully(magic);
|
imageInput.readFully(magic);
|
||||||
|
@@ -10,6 +10,7 @@ import javax.imageio.spi.ImageReaderSpi;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -86,6 +87,7 @@ public final class DDSImageReader extends ImageReaderBase {
|
|||||||
|
|
||||||
private void readHeader() throws IOException {
|
private void readHeader() throws IOException {
|
||||||
if (header == null) {
|
if (header == null) {
|
||||||
|
imageInput.setByteOrder(ByteOrder.LITTLE_ENDIAN);
|
||||||
header = DDSHeader.read(imageInput);
|
header = DDSHeader.read(imageInput);
|
||||||
|
|
||||||
imageInput.flushBefore(imageInput.getStreamPosition());
|
imageInput.flushBefore(imageInput.getStreamPosition());
|
||||||
|
Reference in New Issue
Block a user