Issue 125267

Summary: Saves odt files with pictures incorrectly, specifically fills content.xml with draw frame repeats.
Product: Writer Reporter: The Steve <thestevemail>
Component: save-exportAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: Armin.Le.Grand, cadeeko, john.ha24, orw
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
ffs, stupid 1000kb limit. just pretend the repeated <draw frame> codes continue for *500 PAGES* none

Description The Steve 2014-07-17 05:04:33 UTC
This has happened more than once, openoffice saved my file & then couldn't open it.  I managed to extract content.xml using Archive manager, found the problem, which was, in essence, FIVE MEGS of the following code, repeated over and over:

<draw:frame draw:style-name="fr1" draw:name="Image2" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>

After this file has been saved, it *incorrectly* reports the .odt filesize as 4.2 MB, despite it having a 5.2 MB file as only a part of it.  When subsequently opening the file, ooo is slowed to a crawl, becoming essentially unusable.  I have no idea why its doing this, but there is something very wrong with openoffice's save routines.  This has happened twice, on two different files.  OpenOffice worked fine on the file for a week or so, then magically saved it wrong and forced me to jump through ridiculous hoops to recover it and my work.  It's possible that its adding an extra <frame> tag for the image each time it saves or autosaves, but I haven't confirmed that.  I've attached the massive content.xml file, which clearly shows the problem.
Comment 1 The Steve 2014-07-17 05:18:06 UTC
Created attachment 83701 [details]
ffs, stupid 1000kb limit.  just pretend the repeated <draw frame> codes continue for *500 PAGES*
Comment 2 Armin Le Grand 2014-07-18 10:16:03 UTC
Hi The Steve, I took a short look at the provided content stream. Indeed the same pic (Pictures/10000000000002AF000005DC073F5D19.png) is included over and over again. It's a repeat of a block of draw:frame statements:

<draw:frame draw:style-name="fr1" draw:name="graphics3" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image2" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image3" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image4" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image5" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image6" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image7" text:anchor-type="char" svg:x="-0.847cm" svg:y="0.305cm" svg:width="10.292cm" svg:height="23.322cm" draw:z-index="0"><draw:image xlink:href="Pictures/10000000000002AF000005DC073F5D19.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>

The question is how you produced this and if it is repeatable. Obviously it's not possible to provide the file /too big), but maybe it's possible to
- tell us if it can be reproduced
- provide the file that produces this when saved
- give info about which exact AOO version you use (about dialog)
- try with AOO410 (if not used) and report if it can be reproduced there, too.

Thanks in advance!
Comment 3 The Steve 2014-07-23 04:20:36 UTC
It is repeatable (it has now happened twice, on two different files).  I can provide the original MS word documents, and the eventual (unusable) .odt result of the second file.  All of these are too big to include here. I am using OpenOffice.org 3.2.1 
OOO320m19 (Build:9505)
ooo-build 3.2.1.4, Debian package 1:3.2.1-11+squeeze8

Please note that it is never the *original* conversion from .doc to .odt that causes the error, but the fact that it starts as a .doc file might be a factor.  I keep Record Changes on all the time, and switch between View Changes on and off.  I work on the file over several weeks, saving often, autosave on & I sometimes leave the file open for extended periods.  One day, it will take a long time to save OR will fail to save in a timely manner and I'll have to kill it.  At that point I know it has saved incorrectly.  The size of content.xml (5.2 MB) is probably related to my "memory per object" setting of 5.2 MB. (ie it fills up the file to the max its allowed.)
This error does NOT happen often.  I have edited over 30 files and only 2 of them ever failed in this manner.  I should be updating ooo soon, and will update if I encounter this error again.  If you have a way to get the original files, I will be happy to send them to you.
Comment 4 Charles 2015-10-17 20:18:13 UTC
Charles Adeeko (17th October 2015)

I tried with the following configuration settings and steps but couldn't reproduce the bug.

Computer Settings:  

Macbook
Operating system: OS X Yosemite version 10.10.5
Processor: 2 GHz Intel Core 2 Duo
Memory: 8 GB 1067 MHz DDR3
Free Storage Space: 84GB

OpenOffice Version: Apache OpenOffice 4.1.1   (AOO411m6(Build:9775)  -  Rev. 1617669
2014-08-13 09:05:42 (Wed, 13 Aug 2014)

Memory Settings in open office:
Graphics cache
use for openOffice 20mb
memory per object  1.0mb
remove from memory after 00.10

saving settings in openOffice
- Save AutoRecovery information every 1 minute

Microsoft Word Mac 2011, Version 14.4.5 (411003)

Steps:
1. Created a Microsoft word document (13546b words and 3 jpegs files, 5mb each in size)
2. Saved document as a word document.
3. Open Openoffice
4. Open word document in OpenOffice - version is set to current version.
5. Save document as .oft file type.
6. Edit document adding 1 or 2 characters and save document (cmd+s)
7. Repeat step 6 20 times within 1 minute.
Comment 5 John 2016-02-16 16:56:47 UTC
Please confirm the number of words in "Created a Microsoft word document (13546b words and 3 jpegs files, 5mb each in size)".  Is that 13,546 words, or 135,46? words?

I ask because your comment: 

6. Edit document adding 1 or 2 characters and save document (cmd+s)
7. Repeat step 6 20 times within 1 minute.

means you are saving the probably large file every 3 seconds!  I doubt the file has finished saving the previous time before you save it again and this is almost certainly the reason for your problem.

Speaking as an AOO Volunteer, I think that problems like this should first be raised on the forum at https://forum.openoffice.org/en/forum/viewforum.php?f=7 where many users could assist you.  You should not jump to the conclusion that this is a reportable bug, and report it as a bug, before doing more analyais.  As it is, you are probably just wasting developers' scarce resources.
Comment 6 John 2016-02-16 17:00:27 UTC
You say "After this file has been saved, it *incorrectly* reports the .odt filesize as 4.2 MB, despite it having a 5.2 MB file as only a part of it."

There is unlikely to be anything wrong in that.  A .odt file is zipped and will no doubt be smaller than the sum of its parts!
Comment 7 John 2016-02-16 17:16:46 UTC
I cannot reproduce the problem with a 15 MByte .odt file (the text of Vanity  Fair twice - 360,000 words) and 3 x 5MB JPG files, where I edit it with Changes ON and then save it.

Each save to my SSD takes about 15 seconds, and Writer "greys out" preventing my doing anything while it is saving.

The pictures in the unzipped .odt are 15 MBytes and the text is a further 3.8 MBytes. I am surprised the images compress as well as they obviously must as JPGs are already compressed.