src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.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, 2015, 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
*** 41,52 **** import org.w3c.dom.Node; import java.awt.image.Raster; import java.awt.image.WritableRaster; - import java.awt.image.SampleModel; - import java.awt.image.DataBuffer; import java.awt.image.DataBufferByte; import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.awt.image.ColorConvertOp; import java.awt.image.RenderedImage; --- 41,50 ----
*** 1046,1056 **** --- 1044,1060 ---- bandOffs, null); // Call the writer, who will call back for every scanline + clearAbortRequest(); + cbLock.lock(); + try { processImageStarted(currentImage); + } finally { + cbLock.unlock(); + } boolean aborted = false; if (debug) { System.out.println("inCsType: " + inCsType);
*** 1223,1232 **** --- 1227,1253 ---- } finally { clearThreadLock(); } } + @Override + protected synchronized void clearAbortRequest() { + setThreadLock(); + try { + cbLock.check(); + if (abortRequested()) { + super.clearAbortRequest(); + // reset C structures + resetWriter(structPointer); + // reset the native destination + setDest(structPointer); + } + } finally { + clearThreadLock(); + } + } + private void resetInternalState() { // reset C structures resetWriter(structPointer); // reset local Java structures