Bug 48168 - HSSFPicture.getImageDimension() does not close ImageInputStream
Summary: HSSFPicture.getImageDimension() does not close ImageInputStream
Status: RESOLVED DUPLICATE of bug 48134
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-10 11:58 UTC by Gareth Jones
Modified: 2009-11-10 21:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gareth Jones 2009-11-10 11:58:11 UTC
In poi-3.5-FINAL

org/apache/poi/hssf/usermodel/HSSFPicture.getImageDimension()

opens an ImageInputStream and does not close it.  Repeated calls to Picture.resize() result in an exception and hang due to too many open files.  Fix by closing stream after image dimensions determined.

268d267
< 		    iis.close();
Comment 1 David Fisher 2009-11-10 12:53:56 UTC
This is likely a duplicate of 48134 which has been resolved in trunk.

https://issues.apache.org/bugzilla/show_bug.cgi?id=48134

Would you please give it a try and see if it resolves your case.

Thanks,
Dave
Comment 2 Gareth Jones 2009-11-10 19:49:24 UTC
Yes it's the same bug as 48134. I thought I searched on getImageDimension, but I guess not.

Anyway, I can confirm (using lsof) that it is fixed in poi-3.6-beta1-20091110.jar (created from build of truck).

Thanks
Gareth
Comment 3 David Fisher 2009-11-10 21:20:38 UTC
Very good. Thanks.

*** This bug has been marked as a duplicate of bug 48134 ***