Fix reading jpeg images where last scanline is higher than the y

source subsampling offset.
This commit is contained in:
Rune Bremnes 2014-02-24 13:27:16 +01:00
parent 1e03850960
commit 0a7f250566

View File

@ -445,6 +445,10 @@ public class JPEGImageReader extends ImageReaderBase {
for (int y = srcRegion.y; y < srcMaxY; y += step) {
int scan = Math.min(step, srcMaxY - y);
if(scan <= param.getSubsamplingYOffset()) {
param.setSourceSubsampling(param.getSourceXSubsampling(),param.getSourceYSubsampling(),param.getSubsamplingXOffset(),0);
}
// Let the progress delegator handle progress, using corrected range
progressDelegator.updateProgressRange(100f * (y + scan) / srcRegion.height);