Bug 42656 - FILESAVE RTF: some images are not exported
Summary: FILESAVE RTF: some images are not exported
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Master old -3.6
Hardware: Other All
: medium major
Assignee: Miklos Vajna
Whiteboard: target:3.5.1 target:3.6.0beta0
Depends on:
Blocks: mab3.5
  Show dependency treegraph
Reported: 2011-11-07 01:34 UTC by Arnaud Versini
Modified: 2012-03-19 14:59 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Test document (25.86 KB, application/vnd.oasis.opendocument.text)
2012-02-04 04:25 UTC, Miklos Vajna

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud Versini 2011-11-07 01:34:45 UTC
Problem description : The problem is under some conditions, RTF saver doesn't add image to the file.

Steps to reproduce:
1. Open the RTF at this url with https://bugs.freedesktop.org/attachment.cgi?id=52627 .
2. Open the presentation at this url https://bugs.freedesktop.org/attachment.cgi?id=53215
3. Edit the mask of the presentation and copy the LibreOffice Logo.
4. Past the logo in the rtf
5. Save the RTF and close the ODP

The resulted RTF have'nt the LibO Logo, the rtf file is still considered as opened (lock file) and contain some strange characters
Comment 1 Jean-Baptiste Faure 2011-11-07 04:00:28 UTC
I reproduce the problem with master under Ubuntu 10.04 x86_64 : LibreOffice 3.5.0 
Build ID: dc06023-82728f1-ca7e6f5-3b66bd0-3cbbc64
- the second picture does not appears in the file opened by the master
- strange characters are there
- the size of the modified RTF file is smaller than the original !

- no problem for me with lock
- the modified RTF file opens quite well in Abiword 2.8.2

Best regards. JBF
Comment 2 Miklos Vajna 2011-11-11 10:11:15 UTC
Based on the above comment, it's highly possible this is not an export but an import bug. :)

Will have a look.
Comment 3 Roman Eisele 2011-12-13 06:30:39 UTC
I can reproduce the problem -- at least partially -- with
LibreOffice 3.5.0 [beta 0]
Build-ID: ef91e38-b1d4df6-090bcba-45cf606-05891e7
running on MacOS X 10.6.8 German.

- yes, the second picture does not appears in the RTF file;
- yes, the size of the modified RTF file is smaller than the original.

-- no problems for me with file locking etc.
-- I’m not sure about the “strange characters” reported by Arnaud and Jean-Baptiste. Of course there are strange-looking things in the file, i.e. many MERGEFIELD items and «$commentaires.Libelle» placeholders. But this is not what you are talking about, is it?

@Arnaud Versini, @Jean-Baptiste Faure:
what kind of “strange characters” do you see in the RTF file, and where exactly?
Comment 4 Roman Eisele 2011-12-13 06:39:43 UTC
Additional hint:
the reduced file size is NOT related to the image-copy problem.

Proof: if I just
1) open the sample RTF document with LibreOffice 3.5.0 beta 0,
2) add a space character somewhere,
3) save the document,
4) delete the space character again,
5) save the document again,
the file size changes from 90.213 bytes (original) to 60.498 bytes (after saving).

The sample document with the inserted (but invisible or invalid) LibreOffice logo is 62.288 bytes in size. This is another evidence for the idea suggested by comments #1 and #2 that the image is there (inside the file), it just gets not imported correctly by LibreOffice 3.5.0 beta 0 again from the changed RTF file.
Comment 5 Jean-Baptiste Faure 2011-12-17 14:45:02 UTC
No strange characters anymore with LO 3.5.0 beta1.
It seems the problem is in the format of the clipboard: if I choose paste as bitmap (4th item in dropdown list of past button) or GDI metafile (3rd button) then the picture is present when the file is reopen.

Both other picture formats seems to be unknown for RTF format. If my guess is correct then two first formats should be converted to bitmap when saving the file in RTF format.

Best regards. JBF
Comment 6 Miklos Vajna 2012-02-04 04:25:33 UTC
Created attachment 56597 [details]
Test document

So the problem is unrelated to copy&paste but an export bug: the attached document can be saved to doc without problems, but the resulting rtf doesn't have a picture at all.
Comment 7 Miklos Vajna 2012-02-04 04:35:55 UTC
More details: the picture is not exported as it's considered as a shape, and the "binary picture data" (pib in rtf) of shapes is not exported. (In fact even the old rtf exporter in go-oo 3.2.x didn't export it.)

I'll check how hard would it be to implement this.
Comment 10 Jean-Baptiste Faure 2012-03-19 14:59:54 UTC
Working as expected in LO 3.5.1 confirmed. Closing. Thank you.