< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 1326,1343 **** System.out.println("maxProgressivePass is " + maxProgressivePass); System.out.println("callbackUpdates is " + callbackUpdates); } // Finally, we are ready to read - - processImageStarted(currentImage); - boolean aborted = false; ! ! // Note that getData disables acceleration on buffer, but it is ! // just a 1-line intermediate data transfer buffer that will not ! // affect the acceleration of the resulting image. aborted = readImage(structPointer, buffer.getData(), numRasterBands, srcBands, bandSizes, --- 1326,1344 ---- System.out.println("maxProgressivePass is " + maxProgressivePass); System.out.println("callbackUpdates is " + callbackUpdates); } // Finally, we are ready to read boolean aborted = false; ! /* ! * All the Jpeg processing happens in native, we should clear ! * abortFlag of imageIODataStruct in imageioJPEG.c. And we need ! * clear abortFlag because without that consecutive read calls ! * will become invalid. ! */ ! clearNativeReadAbortFlag(structPointer); ! processImageStarted(currentImage); aborted = readImage(structPointer, buffer.getData(), numRasterBands, srcBands, bandSizes,
*** 1511,1520 **** --- 1512,1527 ---- JPEGHuffmanTable [] abbrevACHuffmanTables, int minProgressivePass, int maxProgressivePass, boolean wantUpdates); + /* + * We should call clearNativeReadAbortFlag() before we start reading + * jpeg image as image processing happens at native side. + */ + private native void clearNativeReadAbortFlag(long structPointer); + public void abort() { setThreadLock(); try { /** * NB: we do not check the call back lock here,
< prev index next >