From 97a8806bfb0c0bab47df74a53267dee4e32a395b Mon Sep 17 00:00:00 2001 From: Harald Kuhr Date: Wed, 17 Feb 2021 09:16:58 +0100 Subject: [PATCH] Better name for source y... --- .../imageio/plugins/sgi/SGIImageReader.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/imageio/imageio-sgi/src/main/java/com/twelvemonkeys/imageio/plugins/sgi/SGIImageReader.java b/imageio/imageio-sgi/src/main/java/com/twelvemonkeys/imageio/plugins/sgi/SGIImageReader.java index bbc291db..738666e8 100755 --- a/imageio/imageio-sgi/src/main/java/com/twelvemonkeys/imageio/plugins/sgi/SGIImageReader.java +++ b/imageio/imageio-sgi/src/main/java/com/twelvemonkeys/imageio/plugins/sgi/SGIImageReader.java @@ -218,8 +218,8 @@ public final class SGIImageReader extends ImageReaderBase { private void readRowByte(int height, Rectangle srcRegion, int[] scanlineOffsets, int[] scanlineLengths, int compression, int xSub, int ySub, int c, byte[] rowDataByte, WritableRaster destChannel, Raster srcChannel, int y) throws IOException { // If subsampled or outside source region, skip entire row - int destY = height - 1 - y; - if (destY % ySub != 0 || destY < srcRegion.y || destY >= srcRegion.y + srcRegion.height) { + int srcY = height - 1 - y; + if (srcY % ySub != 0 || srcY < srcRegion.y || srcY >= srcRegion.y + srcRegion.height) { if (compression == SGI.COMPRESSION_NONE) { imageInput.skipBytes(rowDataByte.length); } @@ -249,14 +249,14 @@ public final class SGIImageReader extends ImageReaderBase { normalize(rowDataByte, 0, srcRegion.width / xSub); // Flip into position (SGI images are stored bottom/up) - int dstY = (destY - srcRegion.y) / ySub; + int dstY = (srcY - srcRegion.y) / ySub; destChannel.setDataElements(0, dstY, srcChannel); } private void readRowUShort(int height, Rectangle srcRegion, int[] scanlineOffsets, int[] scanlineLengths, int compression, int xSub, int ySub, int c, short[] rowDataUShort, WritableRaster destChannel, Raster srcChannel, int y) throws IOException { // If subsampled or outside source region, skip entire row - int destY = height - 1 - y; - if (destY % ySub != 0 || destY < srcRegion.y || destY >= srcRegion.y + srcRegion.height) { + int srcY = height - 1 - y; + if (srcY % ySub != 0 || srcY < srcRegion.y || srcY >= srcRegion.y + srcRegion.height) { if (compression == SGI.COMPRESSION_NONE) { imageInput.skipBytes(rowDataUShort.length * 2); } @@ -286,7 +286,7 @@ public final class SGIImageReader extends ImageReaderBase { normalize(rowDataUShort, 0, srcRegion.width / xSub); // Flip into position (SGI images are stored bottom/up) - int dstY = (destY - srcRegion.y) / ySub; + int dstY = (srcY - srcRegion.y) / ySub; destChannel.setDataElements(0, dstY, srcChannel); }