commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Gouesse (JIRA)" <>
Subject [jira] [Commented] (IMAGING-128) TIFF Image Writer is not flushing output
Date Mon, 28 Jul 2014 19:08:39 GMT


Julien Gouesse commented on IMAGING-128:

I find the use of close() and flush() inconsistent in commons-imaging. It's not called when
writing TIFF and ICNS images but it is called when writing GIF images (see GifImageParser.writeImage()).

> TIFF Image Writer is not flushing output
> ----------------------------------------
>                 Key: IMAGING-128
>                 URL:
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Gary Lucas
>            Priority: Minor
>         Attachments: Imaging_128_Patch_1.patch
> The writeImage() method in the TiffImageWriterBase class takes an
argument as the destination for its output.  It does not explicitly call flush() on the output
stream when it is finished writing data.  If the calling application allows the output stream
to go out of scope, rather than explicitly calling close(), any pending output will be lost
and the output image file will be left in a broken state.  Although, ideally, applications
SHOULD explicitly call close() on an i/o file, we should probably add a call to flush to the
writeImage method to provide some robustness.
> This behavior was observed in Java 7.

This message was sent by Atlassian JIRA

View raw message