You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/11/05 04:48:11 UTC

DO NOT REPLY [Bug 48134] New: ImageIO Image left open when using Picture.resize() method.

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

           Summary: ImageIO Image left open when using Picture.resize()
                    method.
           Product: POI
           Version: 3.5-FINAL
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: jrlambs@yahoo.com


In XSSF

When calling the Picture.resize() function after adding a picture to a
spreadsheet the file reference used by the imageio package is being left open.

How to repeat:  
1) Use Quick Start Code for inserting an image in an Excel sheet.
2) Run the code, having it pause just after calling the "resize" function.
3) Check the temp directory on your system.. a file is present called
"imageioXXXX.tmp"
4) Allow the program to Continue/End.  (The file is now gone)

I have a J2EE project which generates spreadsheets and embeds images in them. 
Each time a spreadsheet is generated a new "imageio" file is generated and held
open by the java server process.  After generating enough spreadsheets the java
process runs out of possible file handles.  The only way to release the hold
on/remove the imageio files int he temp directory is to shut down the server
and restart it.  When java ends, the files are released.

I believe the bug is located in the getImageDimension() function in the
HSSFPicture.java file.  This function opens an ImageIO Image to get its
dimension but never closes it.  

I've tried both version 3.2 and 3.5 and the bug is present in both.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 48134] ImageIO Image left open when using Picture.resize() method.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48134

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2009-11-06 11:34:02 UTC ---
A very good catch, thanks!

It turns out that ImageReader must be disposed, otherwise it may continue to
hold system resources indefinitely.

The fix was committed in r833527

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 48134] ImageIO Image left open when using Picture.resize() method.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48134

David Fisher <df...@jmlafferty.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gjones@arenapharm.com

--- Comment #2 from David Fisher <df...@jmlafferty.com> 2009-11-10 21:20:38 UTC ---
*** Bug 48168 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org