Merge pull request #39 from escenic/upstream

JPEGImageReader throws "IllegalStateException: sourceRegion.height <= subsamplingYOffset!"
This commit is contained in:
Harald Kuhr
2014-03-02 22:15:06 +01:00
7 changed files with 54 additions and 0 deletions
@@ -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);