Copy & Paste Image from Writer copies only empty frame

Hello,
I have an issue with quite specific pictures in LO Writer 7.6.5.2 on Windows. The issue did not appear in 7.1.6.
The issue is, when the picture is copied from LO Writer to be pasted in another application, like MS Paint, only an empty Picture will appear. The right size is kept though, the picture size in Paint gets adapted.
A workaround is to do a screenshot of the picture and paste it then from the clipboard, that will work just fine. The issue seems to appear specifically for pictures which are pasted into LO from a software called Phoenix from Certara. Sadly this is not a free software, so I can not get a copy to check the clipboard when the image is copied from there, nor can I provide an example file at this moment. Maybe the issue is known and I just did not find it with the search function. If so, sorry for my bad searching. I also tried pasting different picture formats to see if one has a similar behavior but could not find anything with the formats I tried.
If I check the pictures folder in the documents .odt file, I can see two files:
A .png file, which is an empty picture, and a .svm file. I can open the png in paint, its containing the empty picture which seems to be put on the clipboard by LO (this is just my impression).
The actual bitmap seems to be within the .svm file. I can not open it with normal image viewers but if I drag it on a new Writer document the image is added correctly.
When dragging the .svm into a new document, Writer will do the same as before when the file is saved: it creates a empty .png with the right frame size and store the bitmap in a .svm in the pictures folder.
Has anyone maybe seen something similar? Thank you!

No.
Try a newer LibreOffice Version.

Thanks for your reply. I just tried LO 24.8.0.3 and its the same.

Have you inserted a new image in LibreOffice bevor?

Please name the operating system you are using and upload a sample file with the problem here. Thank you.

I am on Windows 11. I copied the image causing issues from an existing document to a new one with the new LO version. I saved the new document and tried to copy the image further into paint. It copies fine between LO, but not to another application. That means my first assumption it only puts an empty png on the clipboard is wrong, the image data must be there but somewhat not readable for paint. LO somehow handles it differently. Maybe svm is put on the clipboard and the png as well and paint will just grab the png part. As said, the image seems to be within the svm, as when I drag only the png in LO, it also appears as an empty image, while the svm works. I should be able to debug the Clipboard content from LO, so I will try that.

The problem with uploading an example file is that I need to ask for permission. Those images do not belong to me so I can not just publish them. I will try to get an example which I am allowed to post but that may take a while. Since the issue is not known, when I create a reproducible example, I could directly create a bug report?!

Is there any information when LO would create a svm file? I don’t know that format and when I normally copy images into LO, this kind of file seems not to appear, not sure if that would be some helpful information.

Yes.


Is there any information when LO would create a svm file?

I don’t think it’s because of LO, since you are pasting from the cache.

According to SVM File - What is an .svm file and how do I open it? an svm file is similar to wmf, so it can contain vector, bitmap or other types. You might be best to select the picture and export as png (or wmf?) if you wanted to open it in Paint. It would be better to go back to the original graphics application to modify the picture however.

Can you Insert - Image instead of pasting into LibreOffice? Or was that how it was inserted originally?

I installed 24.8 on a notebook where I did not test this before, I did not want to change my current main installation. The image was only copied from the existing file to a new one within LO, for the first time on this machine. Then into paint. So every cache should only come from LO. I’ll try to get an example, thanks for your help!

Thanks for that link about SVM, that is very interesting. I may be able to create an example with Draw, lets see. I tried export as WMF, is it is described as similar, so far but it behaves as expected, I can paste it outside of LO. I’ll try further.
If I insert - Image, that asks for a file, so it should be the same as when I drag and drop an image into writer, no? That behaves as described above: I can extract the png and svm from the original file and drag it into a new document. The png will be an empty frame, the svm will appear like the original picture, but can not be used further via c&p. Maybe export would work, not sure where to find that option, but then just using a screenshot tool seems faster.
The original was inserted via copy and paste from Phoenix.
Probably the issue at this point already, in 7.1 the inserted pictures did not have the issue and I just tried with older files, created by LO 7.1, the picture there can still be pasted out of LO, also in 7.6 and 24.8. So something probably goes wrong on the first paste from Phoenix to LO.
As I don’t have Phoenix, I can not test this in 24.8 myself, I will ask the person who gave me the file with the picture to update and see if the issue is gone then and 24.8 will save the file correctly.
Also there is a difference between 7.6.5.2 and 24.8 when I use the “edit with external tool” option, if you mean that with export. In 24.8 the windows preview tool actually gets the picture, in 7.6, it opens an empty picture as well. That’s already something and looks promising. Thanks everyone!

The second entry in this question gives three methods of exporting images from Phoenix, it might be worth a look. I suppose export as Word would export images as wmf, see Outputting JPEG/PNG plots at once - Phoenix WNL basics - Certara Forums

1 Like

I have some more infos in this case here. I found when I copy an image which causes issues to Draw, from there I can copy it into MS Paint. I can also copy it back from Draw to Writer, and then it works as expected also in Writer, as I can also copy it further into paint without issues then. The interesting part is, that no new image is in the .odt pictures folder despite showing two images where for one c&p works, for the other one not. The same svm file is referenced twice in the content.xml with different styles. One of them (fr1) contains

style:parent-style-name=“Graphics”

<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
<style:graphic-properties style:mirror="none" fo:clip="rect(0in, 0in, 0in, 0in)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
</style:style>
...
<style:style style:name="gr2" style:family="graphic" >
<style:graphic-properties draw:stroke="none" svg:stroke-width="0in" svg:stroke-color="#3465a4" draw:marker-start="" draw:marker-start-width="0.0783in" draw:marker-start-center="false" draw:marker-end="" draw:marker-end-width="0.0783in" draw:marker-end-center="false" draw:fill="none" draw:fill-color="#729fcf" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" fo:padding-top="0.0492in" fo:padding-bottom="0.0492in" fo:padding-left="0.0984in" fo:padding-right="0.0984in" fo:wrap-option="wrap" draw:shadow="hidden" draw:shadow-offset-x="0.0783in" draw:shadow-offset-y="0.0783in" draw:shadow-color="#808080" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0in, 0in, 0in, 0in)" draw:image-opacity="100%" style:mirror="none" loext:decorative="false" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/>
</style:style>

Style fr1 and gr2 are used, I removed gr1.

The drawing objects:

<text:p text:style-name="Standard">
<draw:frame text:anchor-type="paragraph" draw:z-index="1" draw:name="Metafile 1" draw:style-name="gr2" draw:text-style-name="P1" svg:width="7.4803in" svg:height="4.313in" svg:x="0.0008in" svg:y="3.9925in">
<draw:image xlink:href="Pictures/20000009000196780000EA5CBEA5915F.svm" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/x-svm">
<text:p/>
</draw:image>
<draw:image xlink:href="Pictures/10000001000008010000049EB82B5F58.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/png"/>
</draw:frame>
<draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="char" svg:width="6.9252in" svg:height="3.9925in" draw:z-index="0">
<draw:image xlink:href="Pictures/20000009000196780000EA5CBEA5915F.svm" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/x-svm"/>
<draw:image xlink:href="Pictures/10000001000008010000049EB82B5F58.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/png"/>
</draw:frame>
</text:p>

When I remove style:parent-style-name=“Graphics” from fr1, everything works as expected. When I put it to the other style (gr2), then the other image has the issue. So I can toggle which image has the issue via editing the style. It also works without draw, when only manually the parent-style-name is removed from contents.xml in a new file.
It seems when I past the image back into Writer from Draw, the parent-style-name is not set. But it is set when the image was originally pasted from Phoenix. And it is also set when I drag the svm file directly into Writer, or paste it with paste special.
Writer is also smart enough to realize its the same file, but handles it differently according to how it was inserted. When Debugging, via java addin which listens to paste events, I see one additional DataFlavor delivered when the image is pasted from Draw or from an instance in Writer where the style has no parent-style name. The additional DataFlavor is Drawing Format.

application/x-openoffice-drawing;windows_formatname="Drawing Format"

It seems to make the difference.
I was testing on LO 2024.8.3 today.
And hopefully I should be able to provide at least a svm file as example to reproduce soon. Sorry for being slow in that regard, I was promised that I should get an example this week. Its really only the dataformat from phoenix, when I create an svm file in open office (which still allows to save in that format) everything works fine.

Once i have an example, I guess I open a bug report directly?!
Since it clearly can work, the svm file itself is not the issue, but apparently the style. Something in the file analysis seems different in Draw, causing it to be handled correctly afterwards also in Writer, so it should in theory be possible to be handled right without Draw, or am I wrong here?

Btw. it seems not possible to use another style on the image from the graphic styles bar in writer, I tried them all. I also tried creating a new style without parent style, but it did not work either.

dummy_graph_example.odt (49.0 KB)
Finally I received an example I am allowed to use. I attached an example file, containing 2 simple graphs. The upper one should behave as described, if copied and pasted into paint, it will be a blank picture in paint. The lower one can be copied and pasted without issue. Both point to the same png/svm in content.xml. The lower one was just copied over to LO Draw and then back in writer. One can reproduce this with the upper graph. It seems strange that it is handled differently despite using the same files. Probably there is a good explanation for this and maybe I am just overlooking something, but it seems odd to me. I retested on LO 25.2.1.2 today. Maybe someone can tell me if that should be considered normal?

On a different note, what happened to the possibility to switch of dark mode in 25.2.1.2? Before I had this in Tools → Options → View, this setting seems missing now. I have issues with the Menues in this version, they just appear as white squares most of the time and then render super slow. Is there still some setting somewhere to switch? Maybe in advanced config?

I expanded the svm file from your text document (it is embedded as 20000009000199B000010DB05EDF1FCC.svm):

  • Inkscape v. 1.4 could not open it (… could not recognize file format)
  • WMFview.exe read: Not a Valid Metafile
  • LibreOffice Draw could open it
  • When inserted from Writer via clipboard into Draw it showed a progress indicator (but not the raster graphics file)

Conclusion: An obviously exotic file format… and LibreOffice can handle it.


EDIT
LibreOffice Draw could not break the opened nor the via clipboard inserted svm object.

1 Like

Thanks for having a look. Indeed an exotic format, I fully agree. Strange that Copy and paste to Draw from writer does not work for you, this worked for me on all versions I tried. And yes, LO seems the only software being able to handle this. I would assume the svm file format is created by LO when the data is first pasted from the clipboard from Certara Phoenix to writer?! It seems to be an LO internal format, some old StarOffice format, if I got the link form EarnestAI right. Maybe it wraps some wmf or just stores the wmf data in its own format?!
Edit: Could also be emf, or emf+ or whatnot which is wrapped or converted. And Certara does something strange, as I tried mimicking this behavior by creating my own wmf, emf, … graphics, but only for them its not working. Just because Draw seems to do the right thing in my testing while Writer behaves strange I wonder if not LO is also doing something strange itself for this format. I just redownloaded my own file, I still have no issues copy/pasting the graphs between LO writer and draw. I have no explanation, sorry that this is not working for you.

From a quick internet search, .svm stands for Starview Metafile, a vector graphics format created for StarOffice and used in OpenOffice and LibreOffice. I could not find the specifications for the format.

Looking at file contents, I see many EM_PLUS and EMF+ tags suggesting there are Windows Enhanced Metafile Plus Extended parts in the payload.

The different behaviour between both graphs may probably be explained. .svm may be vector format used in the initial versions of OO and LO (when their file extensions began with .s instead of .o). Then Draw knows how to handle the file. When you copy, the clipboard receives several variants of the data. Pasting into Writer selects a “manageable” format, an image in this case, as .svm is probably considered obsolete. I remind you that the graphics feature in Writer (its drawing objects) is a reduced and simplified version of what is available in Draw because Writer is text oriented. Then only the most recent format is accepted as you can convert in Draw.

1 Like

Thank you for having a look! Indeed Draw gives writer more information, the additional data on the clipboard, as written above, in Java I see an additional Data-Flavor. But Writer will use the same svm file, before and after pasting, there is no change. What is different is the style used in content.xml when pasting. One can just manually switch the style in content.xml even if it never was in draw. Then Draw is not needed to have writer create a copyable version of the same file. Also Writer must be creating this file on the initial paste event from the external software, it shows the graph, so it seems to be able to handle this format fairly well, or am I wrong here? Its just when the style in content.xml is right, writer will select the right data to put on the clipboard while otherwise it will put some empty picture in. Kind of like it puts svm and png on, and paint will grap the png, which is empty but when the style is right, Writer will actually create a png containing the graph.
Edit: So I think you are right that Draw will give the additional information to handle this correctly. I guess my question is, should not Writer be able to handle this itself correctly as well, if it creates the file, shows the graph, and just a difference in the selected style makes it work also in copy & paste. Maybe its not possible for writer to select the right style for any reason by itself, but maybe it would be. That is basically what I wonder about here.

On a further test I exported an ellipse on OpenOffice 3.4.1 as an SVM file. LO 24.8.5.2 could break the imported file and now it is possible to modify it (it is like convert to contour - Bezier control points for line and area).


Difference to your example:
Your sample svm file behaves like a bitmap which was inserted as a drawing - therefore could not be broken and is a weird entity.

Yes I tried similar things, it seems not possible to create an svm file as messed up as this one without Phoenix :smiley: I totally agree this is weird. Thanks for the hint that the openoffice svm can still be modified, my example one indeed behaves like a bitmap. I think I did not realize that before.