Error saving document with JPG image inserted
Error saving document with JPG image inserted
I'm using OO 3.0 Beta. In Writer, I create a new document, then select Insert->Picture From File, then select a JPG image and it inserts it properly.
Next, when I try to save the document, it issues an error window with the following message:
"Error saving the document Untitled2:
Error in writing sub-document styles.xml"
Additional notes:
- If I then remove the image, I still can't save the document (same error message).
- If I create a new document and add some text but never insert any images, I can save the document successfully.
- The problem occurs with several JPG or GIF images I have tried inserting.
Next, when I try to save the document, it issues an error window with the following message:
"Error saving the document Untitled2:
Error in writing sub-document styles.xml"
Additional notes:
- If I then remove the image, I still can't save the document (same error message).
- If I create a new document and add some text but never insert any images, I can save the document successfully.
- The problem occurs with several JPG or GIF images I have tried inserting.
- Bhikkhu Pesala
- Posts: 1253
- Joined: Mon Oct 08, 2007 1:27 am
Re: Error saving document with JPG image inserted
Please attach one such image for testing.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
LibreOffice 6.0.4 on Windows 10
Re: Error saving document with JPG image inserted
I'm not able to duplicate your results just testing a few simple images, which does lead me to suspect something about the images you're working with, so do please upload a sample as requested.
I would like to know the origin of the images you're inserting, and does the same thing happen if you create the text first, save, then insert one of those images and save? Does it happen with all jpg and gif images, or just some certain ones?
What are the style settings for Graphics? Find those in the Stylist (F11, Styles and Formatting window) in the Frames category. Have you changed anything there?
Is there anything else special about your document that we might need to know... for example, does it contain other kinds of objects or content other than text and images? Are you pasting images into a table?
Are you using the Save command in the File menu, or the Save tool in the toolbar, or a keyboard shortcut?
I would like to know the origin of the images you're inserting, and does the same thing happen if you create the text first, save, then insert one of those images and save? Does it happen with all jpg and gif images, or just some certain ones?
What are the style settings for Graphics? Find those in the Stylist (F11, Styles and Formatting window) in the Frames category. Have you changed anything there?
Is there anything else special about your document that we might need to know... for example, does it contain other kinds of objects or content other than text and images? Are you pasting images into a table?
Are you using the Save command in the File menu, or the Save tool in the toolbar, or a keyboard shortcut?
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
- rabidrobot
- Posts: 1
- Joined: Sat Jun 28, 2008 12:45 am
Re: Error saving document with JPG image inserted

Hi, I am also using the 3.0Beta, and experiencing similar trouble.
Before importing the image, I can save in odt format, after an image insert, attempting to save in odt results in this error:
Error saving the document Untitled1:
Error in writing sub-document styles.xml
This error appears after one has gone through the Save dialog, and usually tried to give the document a new name during that. I can save the file as a *.doc, giving it a name, then try and save again as *odt--the error is still there, but using the document name given when saved as doc.
Here is an image that raised the issue for me, but I tried a few others and had similar results. I only tried pngs.
Also, for what its worth, I can do it to a simple base new file in Writer by adding an image first thing. It should (not) work right away.
Edit:
I am saving through file menu, and usually import the image by Insert->Pictuer->From File
!
- Attachments
-
- Small png file that causes error for me
- xanderlih_drop.png (17.1 KiB) Viewed 8523 times
OOo 3.0.X on MS Windows Vista
Re: Error saving document with JPG image inserted
No problem under Linux with OOo-dev 3.0 Beta 300m21(Build:9319).
AOO4/LO5 • Linux • Fedora 23
- Bhikkhu Pesala
- Posts: 1253
- Joined: Mon Oct 08, 2007 1:27 am
Re: Error saving document with JPG image inserted
No problem here with Developer build 3.0 on Windows XP Home.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
LibreOffice 6.0.4 on Windows 10
- Hagar Delest
- Moderator
- Posts: 33614
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Error saving document with JPG image inserted
Try to change the anchoring of the pic to As character perhaps (and not To character).
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
Re: Error saving document with JPG image inserted
This is why I asked swbrains about the Graphics style settings and about the image origin. What program created your png files? What Graphics settings are you using? Have you changed any styles in the default template... are you using the standard Default template or one of your own making? Because the error is in styles.xml, it's important to know anything in particular that may be related to styles. Knowing the Graphics settings and how you're anchoring the images may help identify the problem, since so many of us cannot reproduce the error. We need to be sure we're testing under the same conditions. If you have anything at all different from the "vanilla" installation, you need to tell us.rabidrobot wrote:Before importing the image, I can save in odt format, after an image insert, attempting to save in odt results in this error:
Error saving the document Untitled1:
Error in writing sub-document styles.xml
Thank you. Good information.rabidrobot wrote:This error appears after one has gone through the Save dialog, and usually tried to give the document a new name during that. I can save the file as a *.doc, giving it a name, then try and save again as *odt--the error is still there, but using the document name given when saved as doc.
I'm in the process of downloading the 3.0 beta to my Vista Home Premium machine for further testing (I am not at the XP computer that already has 3.0 installed) so I'll try your renaming method to see if I can reproduce the error that way.
One further question. When did you download your beta version? Perhaps you're working with a different build. You can get the exact build number by going to Help> About OpenOffice.org. Hold the Ctrl key and press S D T in that order. This should open a scrolling text. The first line contains the dev build.
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Error saving document with JPG image inserted
Hi,
Here is more information:
- Version: 300m2 Build:9301
- Attached are several of the images I use to cause the error. It happens with every image I test with. Each image is of a different format (JPG, GIF, PNG), so the error is not specific to image type.
- Image sources:
> The star background5 image (JPG) was downloaded from fotolia.com so it should be a valid image file.
> the plumber (GIF) image is from the Microsoft site (office.microsoft.com -> clipart search), so it should be an acceptable format internally.
> the demo_menu (PNG) image was created by me from scratch in Photoshop Elements 5.0.
- It doesn't matter if I enter text, then insert the image, or insert the image immediately upon creation of the new document, the error stil occurs.
- In each test, I closed and restarted Writer before testing with a new image.
- When saving, I accept the default file type (ODT) and only enter a filename, such as test1, test2, etc.
- If I change the anchor to "Character", the error still occurs.
- If I open a new doc, enter some small text ("Test 1") and save, it works. If I enter more text and save again, it still works. Once I insert the image (any image) and try to save, the error occurs. If I immediately remove the image from the document and try to save, it still gives the same error, so it's not the actual presence of the image in the document at save time, just the fact that it's been added at some point during the session.
- In a similar test to the previous note, I opened a new doc, added text and saved successfully. Then I added the plumber GIF image and DID NOT SAVE the doc. Then I immediately deleted the image from the document and tried to save, but received the error message.
- My OO has the Load/Save preferences set to enable conversion of documents on Load and Save to be compatible with MS Office. I tried disabling all of the Load/Save compatibility options, but the error still occurred using the tests described above even when none of these options were enabled.
- I wasn't sure which particular settings in the Styles window (F11) you were interested in knowing, but suffice it to say I had never seen that window before and did not knowingly make any changes to the settings in that window. In my tests, I select Insert->Picture (from file), the image is inserted, and I immediately select Save and the error occurs. I do not move, resize, or otherwise change the default placement/insertion of the image in any test.
- There is nothing else special about the docs. I create a new empty doc for each test and it still fails. There are no other objects other than some simple text (like "test 1"). Even if no text is inserted the error occurs if an image is inserted.
- Regardless of the Save command used, the error occurs: File->Save, File-Save As, or the Save button on the toolbar.
I hope this additional info helps. Please feel free to let me know if you need additional information.
Thanks
Here is more information:
- Version: 300m2 Build:9301
- Attached are several of the images I use to cause the error. It happens with every image I test with. Each image is of a different format (JPG, GIF, PNG), so the error is not specific to image type.
- Image sources:
> The star background5 image (JPG) was downloaded from fotolia.com so it should be a valid image file.
> the plumber (GIF) image is from the Microsoft site (office.microsoft.com -> clipart search), so it should be an acceptable format internally.
> the demo_menu (PNG) image was created by me from scratch in Photoshop Elements 5.0.
- It doesn't matter if I enter text, then insert the image, or insert the image immediately upon creation of the new document, the error stil occurs.
- In each test, I closed and restarted Writer before testing with a new image.
- When saving, I accept the default file type (ODT) and only enter a filename, such as test1, test2, etc.
- If I change the anchor to "Character", the error still occurs.
- If I open a new doc, enter some small text ("Test 1") and save, it works. If I enter more text and save again, it still works. Once I insert the image (any image) and try to save, the error occurs. If I immediately remove the image from the document and try to save, it still gives the same error, so it's not the actual presence of the image in the document at save time, just the fact that it's been added at some point during the session.
- In a similar test to the previous note, I opened a new doc, added text and saved successfully. Then I added the plumber GIF image and DID NOT SAVE the doc. Then I immediately deleted the image from the document and tried to save, but received the error message.
- My OO has the Load/Save preferences set to enable conversion of documents on Load and Save to be compatible with MS Office. I tried disabling all of the Load/Save compatibility options, but the error still occurred using the tests described above even when none of these options were enabled.
- I wasn't sure which particular settings in the Styles window (F11) you were interested in knowing, but suffice it to say I had never seen that window before and did not knowingly make any changes to the settings in that window. In my tests, I select Insert->Picture (from file), the image is inserted, and I immediately select Save and the error occurs. I do not move, resize, or otherwise change the default placement/insertion of the image in any test.
- There is nothing else special about the docs. I create a new empty doc for each test and it still fails. There are no other objects other than some simple text (like "test 1"). Even if no text is inserted the error occurs if an image is inserted.
- Regardless of the Save command used, the error occurs: File->Save, File-Save As, or the Save button on the toolbar.
I hope this additional info helps. Please feel free to let me know if you need additional information.
Thanks
Re: Error saving document with JPG image inserted
That is 19 versions behind the current snapshot. Is there any point in discussing old snapshots?Version: 300m2 Build:9301
The snapshots are for testing, not for doing "real work". Is there some reason you need to use the snapshot?
AOO4/LO5 • Linux • Fedora 23
Re: Error saving document with JPG image inserted
Can't reproduce this with the Dev300m21 (Build:9319) snapshot, using both of your images in the same doc, and renaming it as described above.
You don't want to trust the Beta for general use yet though, only for testing and curiosity. I'd go back to 2.4.1 if I were you. Trying to resolve issues on old snapshots isn't productive. Because the snapshot changes all the time, the 'build' you have is superseded very quickly by a later version.
You don't want to trust the Beta for general use yet though, only for testing and curiosity. I'd go back to 2.4.1 if I were you. Trying to resolve issues on old snapshots isn't productive. Because the snapshot changes all the time, the 'build' you have is superseded very quickly by a later version.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Gurkha Welfare Trust
Re: Error saving document with JPG image inserted
I'll try the latest snapshot. I wasn't using it for production work. I was just evaluating it to see if it was something I could use in place of MS Office in the future.
Re: Error saving document with JPG image inserted
Update: I downloaded and installed what I believe is the latest snapshot. In the About window it reads Dev300m22 (Build 9321). Performing the same test causes the same error when attempting to save the file. This happens on two PCs: my desktop and my laptop. Both are running Vista Home Premium SP1.
Re: Error saving document with JPG image inserted
Thanks for updating.
It sounds like an error that needs to be reported. It must be a Vista-related problem.
There have been many reports of problems with saving files under Vista, rigtht now it seems they are marked as "FIXED", so I think it could well be a new problem that should be reported.
Has anyone else here tried this under Vista?
It sounds like an error that needs to be reported. It must be a Vista-related problem.
There have been many reports of problems with saving files under Vista, rigtht now it seems they are marked as "FIXED", so I think it could well be a new problem that should be reported.
Has anyone else here tried this under Vista?
AOO4/LO5 • Linux • Fedora 23
Re: Error saving document with JPG image inserted
Yes, I started some tests and could duplicate the issue with any image format, but actually the problem seemed to be not so specific to images, but a bit wider, so my testing became a bit involved. I never completed testing because other high-priority things are going on, so I am unable to spend much time on forum issues for the next couple of weeks... but for what it's worth, here are my notes:
I can confirm that in the build I just downloaded, 3.0 Beta build 9301 on Windows Vista Home Premium SP1.
- Inserted an image with Insert> Picture> From file (selected a .jpg image)
- Chose File> Save, entered a document name, which resulted in the error.
- With no other changes to the document, File> Save As resulted in OOo not responding, trying to open the Save As dialog; I had to close the window to abort the save.
- Confirmed QuickStarter was closed and, in System Explorer, saw that no soffice process was still running.
- Opened OOo 3.0 again and the Untitled1 file recovered successfully (of course, without the inserted image).
- Inserted the image again, and immediately tried "Save As" again; again it hung before it could bring up the Save As dialog. (I left it hanging, to see if anything might happen. Something during this time changed my screen resolution to 800x600, and the high-res setting is no longer available in Display Settings... it only goes up to 1024x768 now. But I can't say that OOo is responsible because I do have other programs running. I'm recording it here only in case it does turn out to be relevant.) [EDIT: Might or might not have been. A later reboot corrected it.]
- Recovered the file again, did Save As without adding any content (so, this is saving a file based on a plain default template, no headers or footers, no style changes, no content in the file). Again, not responding.
-Next, I cancelled file recovery so it opened a new file. Without adding any content I tried Save As again -- but it hung again.
- Cancelled recovery on that file, typed some text in the new file and tried File> Save As again (though I could have done a regular Save this time). Once again, not responding.
- Cancelled recovery on that file and typed some text in the new file, and this time chose Save. Same result.
Oddly, I can't seem to save any file at all now... won't even bring up the Save or Save As dialog for me to try a different file format or file name. Tried saving a Calc file, Impress, and Draw, with the same results.
---> By the way, I have been testing other programs, which all can save just fine. OOo 2.4.1 is just fine too. The only problem is with 3.0 Beta.<---
Re-ran Setup.exe with the Repair option, and tried Calc again. The recovery for the previously unsavable files came up again.
Rebooted the computer.
Deleted recovery.xcu and restarted OOo. Nope, still no help.
Uninstalled 3.0 completely and reinstalled. NOTE: This entailed going to the Start button, selecting Computer in the right pane, clicking on my user folder in the left pane under Folders (so in my case, Fox), double-clicking AppData, then Roaming, and deleting the OpenOffice.org 3.0 folder.
Still in that window, selecting Computer (under Folders in the left pane), Program Files, deleting the openOffice.org 3.0 folder (which required two or three levels of verifications forced by Vista before it could complete). That's all I found, so I then rebooted to clear the registry (I hope).
Reboot fixed the display issues; not sure what was happening there, but it seems fine now.
I can confirm that in the build I just downloaded, 3.0 Beta build 9301 on Windows Vista Home Premium SP1.
- Inserted an image with Insert> Picture> From file (selected a .jpg image)
- Chose File> Save, entered a document name, which resulted in the error.
- With no other changes to the document, File> Save As resulted in OOo not responding, trying to open the Save As dialog; I had to close the window to abort the save.
- Confirmed QuickStarter was closed and, in System Explorer, saw that no soffice process was still running.
- Opened OOo 3.0 again and the Untitled1 file recovered successfully (of course, without the inserted image).
- Inserted the image again, and immediately tried "Save As" again; again it hung before it could bring up the Save As dialog. (I left it hanging, to see if anything might happen. Something during this time changed my screen resolution to 800x600, and the high-res setting is no longer available in Display Settings... it only goes up to 1024x768 now. But I can't say that OOo is responsible because I do have other programs running. I'm recording it here only in case it does turn out to be relevant.) [EDIT: Might or might not have been. A later reboot corrected it.]
- Recovered the file again, did Save As without adding any content (so, this is saving a file based on a plain default template, no headers or footers, no style changes, no content in the file). Again, not responding.
-Next, I cancelled file recovery so it opened a new file. Without adding any content I tried Save As again -- but it hung again.
- Cancelled recovery on that file, typed some text in the new file and tried File> Save As again (though I could have done a regular Save this time). Once again, not responding.
- Cancelled recovery on that file and typed some text in the new file, and this time chose Save. Same result.
Oddly, I can't seem to save any file at all now... won't even bring up the Save or Save As dialog for me to try a different file format or file name. Tried saving a Calc file, Impress, and Draw, with the same results.
---> By the way, I have been testing other programs, which all can save just fine. OOo 2.4.1 is just fine too. The only problem is with 3.0 Beta.<---
Re-ran Setup.exe with the Repair option, and tried Calc again. The recovery for the previously unsavable files came up again.
Rebooted the computer.
Deleted recovery.xcu and restarted OOo. Nope, still no help.
Uninstalled 3.0 completely and reinstalled. NOTE: This entailed going to the Start button, selecting Computer in the right pane, clicking on my user folder in the left pane under Folders (so in my case, Fox), double-clicking AppData, then Roaming, and deleting the OpenOffice.org 3.0 folder.
Still in that window, selecting Computer (under Folders in the left pane), Program Files, deleting the openOffice.org 3.0 folder (which required two or three levels of verifications forced by Vista before it could complete). That's all I found, so I then rebooted to clear the registry (I hope).
Reboot fixed the display issues; not sure what was happening there, but it seems fine now.
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Error saving document with JPG image inserted
This issue appears to be fixed with the 3.0 Beta 2 release.
Can everyone confirm?
Can everyone confirm?
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Error saving document with JPG image inserted
I just downloaded the current beta (version 3.0.0 Beta - BEB300m3 Build 9328) and the problem does not occur any longer when saving after inserting a JPG under Vista.
-- Vinnie
-- Vinnie
Re: Error saving document with JPG image inserted
I use OpenOffice 3.0 beta 2 (BEB300m3 build 9328) and the problem happened again with all picture formats.
The error message is: "Error in saving the document Untitled 1: Error in writing sub-doccument styles.xml."
Could any body check it?
The error message is: "Error in saving the document Untitled 1: Error in writing sub-doccument styles.xml."
Could any body check it?
OOo 3.0.X on MS Windows Vista
Re: Error saving document with JPG image inserted
Hi,
I used Vista64 and OOo 3.0 beta 2 and encountered the saving-problem as well. I tried Build 9328 and it didn't work either, except for one time when I launched OOo as admin. But I coudn't repeat that. Currently i'm using DEV300m28 Build 9337 but nothing has changed for me. I think Vista causes this. Maybe there is a workaround. But for now, it doens't work
.
edit: Well, m29 doesn't work either, everything's the same. Just for the record.
I used Vista64 and OOo 3.0 beta 2 and encountered the saving-problem as well. I tried Build 9328 and it didn't work either, except for one time when I launched OOo as admin. But I coudn't repeat that. Currently i'm using DEV300m28 Build 9337 but nothing has changed for me. I think Vista causes this. Maybe there is a workaround. But for now, it doens't work
edit: Well, m29 doesn't work either, everything's the same. Just for the record.
OOo 3.0.X on MS Windows Vista
-
andychannelle
- Posts: 1
- Joined: Mon Aug 11, 2008 10:53 pm
Re: Error saving document with JPG image inserted
I'm having the same issue with a fresh install.
New document > Save (OK)
Add Graphic > Save Error Writing Sub-Document Styles.xml
I tried doing Save As... and a different file name to see if that might make a difference, and it saved under the new name but with a 0 bytes and, obviously, no way to reopen. Subsequent attempts to save met with the same error. Deleting the image makes no difference.
I've used the current build under Linux (Ubuntu, SUSE, Xandros), OS X and Win XP with no sighting of this problem, which suggests it's specific to Vista.
New document > Save (OK)
Add Graphic > Save Error Writing Sub-Document Styles.xml
I tried doing Save As... and a different file name to see if that might make a difference, and it saved under the new name but with a 0 bytes and, obviously, no way to reopen. Subsequent attempts to save met with the same error. Deleting the image makes no difference.
I've used the current build under Linux (Ubuntu, SUSE, Xandros), OS X and Win XP with no sighting of this problem, which suggests it's specific to Vista.
OOo 2.3.X on Ubuntu 8.x + Vista, OS X, OpenSUSE, Xandros
Re: Error saving document with JPG image inserted
Well, it seems like i managed to fix the problem. Just use OOos dialogs for saving, described in Issue 87244 - hopefully it works for you as well..
OOo 3.0.X on MS Windows Vista
Re: Error saving document with JPG image inserted
Nice work finding that! Thank you.
I followed the link... and have to say, I've never seen an issue with so many other issues marked as duplicates. Seems to have been a bigger problem than reflected in this forum.
I followed the link... and have to say, I've never seen an issue with so many other issues marked as duplicates. Seems to have been a bigger problem than reflected in this forum.
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit