Bug 30156 - Image file opened but not closed
Summary: Image file opened but not closed
Status: CLOSED DUPLICATE of bug 34308
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: 0.20.5
Hardware: All other
: P3 critical
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-16 17:58 UTC by Sukit Tretriluxana
Modified: 2012-04-01 13:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sukit Tretriluxana 2004-07-16 17:58:53 UTC
When using Jimi library to handle images, the code that does this open the 
stream to the image file using (url.getStream()) but did not close it. This 
prevent the deletion on the image files. 

This doesn't have much impact on on-off application but it creates a lot of 
troubles in the long-standing web application.

I have confirmed this by trying modifying the source code (JimiImage.loadImage
()) to close the stream and it worked.
Comment 1 Jens Scheidtmann 2004-07-26 12:49:34 UTC
This is also true for JpegImage.java and JAIImage.java.
Comment 2 M.H. 2004-07-30 08:20:57 UTC
I changed this to critical because in a server application, this constantly 
results in OutOfMemory excpetions after some time. And the only solution is to 
exit the application (JVM) and restart it again. So far, we have to exit our 
application every morning and restart it again ... :-(

I noticed this as some temporary image files used for FOP transformation can't 
be deleted after the processing (and freeing up all possible objects).
Comment 3 M.H. 2004-07-30 14:08:06 UTC
yup, it would be great to introduce a 


InputStream inputStream = null;
try {
    inputStream = ...
    ...
} finally {
    if (inputStream != null) try { inputStream.close();} catch (IOException 
ioe) { /* ignore or anything else */ }
}
Comment 4 Tino Schwarze 2005-04-05 18:25:31 UTC
Patch available as bug #34308 

*** This bug has been marked as a duplicate of 34308 ***
Comment 5 Glenn Adams 2012-04-01 13:53:28 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs