/// <summary> /// Finalizes the image creation and closes the file stream. /// This MUST be called after writing the lines. /// </summary> public void End() { if (currentRow != ImgInfo.Rows - 1) { throw new IO.IOException($"All rows have not been written. Last row is: {currentRow} / {ImgInfo.Rows-1}"); } datStreamDeflated.Close(); datStream.Close(); WriteLastChunks(); WriteEndChunk(); if (this.ShouldCloseStream) { outputStream.Close(); } }
/// <summary> /// Finalizes the image creation and closes the file stream. /// This MUST be called after writing the lines. /// </summary> public void End() { if (rowNum != ImgInfo.Rows - 1) { throw new PngjOutputException("all rows have not been written"); } try { datStreamDeflated.Close(); datStream.Close(); WriteLastChunks(); WriteEndChunk(); if (this.ShouldCloseStream) { outputStream.Close(); } } catch (IOException ex) { throw new PngjOutputException(ex); } }