if (!_bImageExternallySpecified) { _img.flush(); _img = null; }   _g2d.dispose(); _g2d = null;
    public final void after() throws RenderingException    {    	super.after();    	    	// SEARCH FOR WRITER USING FORMAT    	Iterator it = null;    	String s = getFormat();    	if (s != null)    	{            it = ImageIO.getImageWritersByFormatName(s);            if (!it.hasNext())            {                it = null; // GET INTO NEXT CONSTRUCT; SEARCH BY MIME TYPE            }    	}    	    	// SEARCH FOR WRITER USING MIME TYPE    	if (it == null)    	{    	    s = getMimeType();    	    if (s == null)    	    {                throw new RenderingException("Unable to find any registered image writers for mime type [" + getMimeType() + "] and format [" + getFormat() + "] for " + getClass().getName());    	    }            it = ImageIO.getImageWritersByMIMEType(s);            if (!it.hasNext())            {                throw new RenderingException("Unable to find any registered image writers for mime type [" + getMimeType() + "]");            }    	}        final ImageWriter iw = (ImageWriter) it.next();        DefaultLoggerImpl.instance().log(ILogger.INFORMATION, "Using "+getFormat()+" image writer " + iw.getClass().getName());                final Object o = (oOutputIdentifier instanceof String) ? new File((String) oOutputIdentifier) : oOutputIdentifier;        try        {            final ImageOutputStream ios = ImageIO.createImageOutputStream(o);            updateWriterParameters(iw.getDefaultWriteParam()); // SET ANY OUTPUT FORMAT SPECIFIC PARAMETERS IF NEEDED            iw.setOutput(ios);            iw.write((BufferedImage) img);            ios.close();        }        catch (Exception ex)        {            throw new RenderingException(ex);        }    }