Bug 28744 - Excel will crash when opening xls-files with images.
Summary: Excel will crash when opening xls-files with images.
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P1 blocker with 27 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-03 14:46 UTC by Johannes Scherbel
Modified: 2008-04-16 05:39 UTC (History)
1 user (show)



Attachments
a working Excel template (untouched by POI) (20.50 KB, application/octet-stream)
2007-03-23 09:04 UTC, Julien Oster
Details
a working Excel template (untouched by POI) (25.50 KB, application/octet-stream)
2007-03-23 09:04 UTC, Julien Oster
Details
a working Excel template (after being processed by POI) (20.50 KB, application/octet-stream)
2007-03-23 09:05 UTC, Julien Oster
Details
a working Excel template (after being processed by POI) (25.50 KB, application/octet-stream)
2007-03-23 09:05 UTC, Julien Oster
Details
a Excel template resulting in a crashing Excel document (untouched by POI) (26.00 KB, application/octet-stream)
2007-03-23 09:06 UTC, Julien Oster
Details
a Excel template resulting in a crashing Excel document (untouched by POI) (26.50 KB, application/octet-stream)
2007-03-23 09:07 UTC, Julien Oster
Details
a crashing Excel document (after being processed by POI) (23.50 KB, application/octet-stream)
2007-03-23 09:07 UTC, Julien Oster
Details
a crashing Excel document (after being processed by POI) (24.00 KB, application/octet-stream)
2007-03-23 09:08 UTC, Julien Oster
Details
Patch for Bug 28744 (1.42 KB, patch)
2007-03-26 05:19 UTC, Yegor Kozlov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Scherbel 2004-05-03 14:46:49 UTC
I tried to use a existing xls-File as template.
The file could be read and manipulated using POI. 
But when opening the written file Excel will view nothing. 
No error message, no crash but also no content of the file.
I used POI 2.5 and Excel 2000.
Comment 1 sergije ulrich 2004-06-04 00:49:27 UTC
I noticed that the size of the file after it has been modified using POI is 
smaller than before modifying it... the only modification i do is to change a 
value of one cell...

original size was 42KB

new size is 29KB

I'm using poi 2.5 and Excel 97
Comment 2 Adam Smith 2004-06-10 13:06:12 UTC
I have verified that this behaviour is not exhibited by version 2.0.
Comment 3 Robert La Ferla 2005-09-08 17:58:36 UTC
I have been experiencing many problems with images and POI using both 2.5.1 and
3.0-alpha including this crash bug.
Comment 4 Robert La Ferla 2005-09-08 18:00:55 UTC
This also occurs on Macintosh (OS X 10.4 Tiger).
Comment 5 Joern Muehlencord 2007-03-21 10:14:15 UTC
We have had the same issue. We found a work around for us working with Alpha2, 3
and RC1. We stored the image to a file, removed the image from the xls and
re-inserted it by Insert -> Image -> From file.

Regards
Joern
Comment 6 Julien Oster 2007-03-23 09:01:36 UTC
Just verified it in a very simple document with POI from SVN. Still doesn't
work, after inserting one of the problematic images with "Insert -> Image ->
From file" the document won't open.

Sometimes the images work, sometimes they don't. It's very strange.
Comment 7 Julien Oster 2007-03-23 09:04:34 UTC
Created attachment 19781 [details]
a working Excel template (untouched by POI)
Comment 8 Julien Oster 2007-03-23 09:04:57 UTC
Created attachment 19782 [details]
a working Excel template (untouched by POI)
Comment 9 Julien Oster 2007-03-23 09:05:29 UTC
Created attachment 19783 [details]
a working Excel template (after being processed by POI)
Comment 10 Julien Oster 2007-03-23 09:05:45 UTC
Created attachment 19784 [details]
a working Excel template (after being processed by POI)
Comment 11 Julien Oster 2007-03-23 09:06:53 UTC
Created attachment 19785 [details]
a Excel template resulting in a crashing Excel document (untouched by POI)
Comment 12 Julien Oster 2007-03-23 09:07:09 UTC
Created attachment 19786 [details]
a Excel template resulting in a crashing Excel document (untouched by POI)
Comment 13 Julien Oster 2007-03-23 09:07:42 UTC
Created attachment 19787 [details]
a crashing Excel document (after being processed by POI)
Comment 14 Julien Oster 2007-03-23 09:08:00 UTC
Created attachment 19788 [details]
a crashing Excel document (after being processed by POI)
Comment 15 Julien Oster 2007-03-23 09:09:25 UTC
I added some testcases, working and non-working versions before and after being
touched by POI.
Comment 16 Yegor Kozlov 2007-03-26 05:18:07 UTC
Julien,

I think I fixed it. Apply the patch and let me know if the problem disappeared. 
If everything is okay, I will commit the fix.

Regards,
Yegor
Comment 17 Yegor Kozlov 2007-03-26 05:19:39 UTC
Created attachment 19797 [details]
Patch for Bug 28744
Comment 18 Julien Oster 2007-03-28 08:37:59 UTC
Yes. Yes, indeed, that seems to fix it. Thank you very much!

Now I have another problem. Using the current POI version, formulas don't get
reevaluated automatically? Even pressing F9 doesn't help. I have to put the
mousecursor into the cell and press enter, or do wacky things like replacing all
'=' with '=', just to get Excel to reevaluate the formulas... This is of course
not connected to your patch or this problem, it's a POI 3.0 thing.

With 2.5.1, everything works. Except for the images. I tried somehow applying
your patch to 2.5.1, but it seems that there are quite some differences.

I suppose it would be very hard to get this patch working with 2.5.1?
Comment 19 James Firth 2007-10-29 04:11:23 UTC
I can recreate this, but only when using Excel with Office Service Pack 3
installed.  Files with images modified by POI cannot be loaded into Excel once
Office SP3 has been installed.
Comment 20 Yegor Kozlov 2008-04-16 05:39:33 UTC
Fixed in trunk

Yegor