Bug Hunting Session
Bug 39960 - Pictures lost/distorted when FILESAVE document as RTF
Summary: Pictures lost/distorted when FILESAVE document as RTF
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0
Keywords:
Depends on:
Blocks: RTF-Images
  Show dependency treegraph
 
Reported: 2011-08-09 08:26 UTC by Rainer Bielefeld Retired
Modified: 2017-10-22 22:29 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document, pls. see original report! (12.82 KB, application/zip)
2011-08-09 08:26 UTC, Rainer Bielefeld Retired
Details
Rich text with distorted images. (2.21 KB, image/png)
2011-08-13 22:39 UTC, Jeffrey
Details
OSX_on_mytest (83.27 KB, application/zip)
2011-10-24 15:38 UTC, rk601
Details
OSX_Space_Test (229.77 KB, application/zip)
2011-10-24 15:44 UTC, rk601
Details
OSX_SVG_test (364.15 KB, application/zip)
2011-10-24 15:48 UTC, rk601
Details
Extracted WMF images from output RTF file (4.24 KB, application/x-zip-compressed)
2015-06-04 14:26 UTC, Vasily Melenchuk (CIB)
Details
screenshot in LibO 5.0.3 (90.91 KB, image/jpeg)
2015-10-25 07:08 UTC, tommy27
Details
screenshot in LibO 5.1.0 (155.50 KB, image/jpeg)
2015-10-25 07:10 UTC, tommy27
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2011-08-09 08:26:13 UTC
Created attachment 50073 [details]
Sample document, pls. see original report!

Pictures in attached sample document will be lost when saved as RTF  with "LibreOffice 3.4.2  - WIN7  Home Premium (64bit) German UI [OOO340m1 (Build:203)]". No pictures visible when I open document with LibO or MS WORD Viewer.

Steps to reproduce:
0. download and unzip attached test kit
1. Open "mytest.odt"
2. save as "mytest.rtf"
3. close document
4. reopen "mytest.rtf"
   Expected: table with pictures
   Actual: no pictures

You can see my export result in mytestresult.rtf from test kit.

Same problem with OOo 3.1.1 and OOo 3.4.
Known for OOo: <http://openoffice.org/bugzilla/show_bug.cgi?id=60831#c6>
So I believe it's inherited from OOo.

Problem still visible with Master "LibO-dev 3.4.5 – WIN7 Home Premium (64bit) English UI 
[(Build ID:d337f79-a24c961-2865670-9752b71-7f8fd43
	2fdd60d-fd28b6a-fd7bf20-aa369cb-28da3fb
	6a9633a-931d089-ecd263f-c9b55e9-b31b807
	82ff335-599f7e9-bc6a545-1926fdf)]"
Comment 1 Jeffrey 2011-08-13 22:39:11 UTC
Created attachment 50189 [details]
Rich text with distorted images.

Saved as rich text, images do not disappear, only wildly distorted. See attachment.

On LibreOffice 3.4  340m1(Build:103) for OpenSuse Linux.
Comment 2 Cor Nouws 2011-08-15 08:39:59 UTC
with a new document, picture added and saved as rtf, it works fine for me in build from master (Build ID: 51e0d9a-4eb4f62-260b7c1 on Ubuntu)
However, indeed size gets changed wrong with picture in table.
Comment 3 rk601 2011-10-24 15:38:51 UTC
Created attachment 52717 [details]
OSX_on_mytest

We conducted three different tests. The first test is based on Rainer Bielefeld 2011-08-09 08:26:13 PDT Sample document, please see the original report.

We tested the desired functionality in the Master:

LibO-dev 3.5.0 
Build ID: f8c2d29-e8c71c5-9c6ea62-4b83b90
On OSX 10.6.8

Located at:

http://dev-builds.libreoffice.org/daily/MacOSX_10.6.7_Intel_no-moz/master/2011-10-24_13.56.07/

with

master~2011-10-24_13.56.07_LibO-Dev_OOO350m1_MacOS_x86_install_en-US.dmg

Steps to reproduce:

1. download and unzip attached test kit
2. Open "mytest.odt"
3. save as "mytest.rtf"
4. close document
5. reopen "mytest.rtf"
   Expected: table with pictures
   Actual: Pictures moved

See attachment for sample documents and screenshots (OSX_on_mytest.zip).
Comment 4 rk601 2011-10-24 15:44:45 UTC
Created attachment 52718 [details]
OSX_Space_Test

We conducted three different tests. The second test is based on mislabel images (jpgs that are listed as png).

We tested the desired functionality in the Master:

LibO-dev 3.5.0 
Build ID: f8c2d29-e8c71c5-9c6ea62-4b83b90
On OSX 10.6.8

Located at:

http://dev-builds.libreoffice.org/daily/MacOSX_10.6.7_Intel_no-moz/master/2011-10-24_13.56.07/

with

master~2011-10-24_13.56.07_LibO-Dev_OOO350m1_MacOS_x86_install_en-US.dmg

Steps to reproduce:

1. download and unzip attached test kit
2. Open "OSX_Space_Test.odt"
3. save as "OSX_Space_Test.rtf"
4. close document
5. reopen "OSX_Space_Test.rtf"
   Expected: table with pictures
   Actual: Pictures moved and gone

See attachment for sample documents and screenshots (OSX_Space_Test.zip).
Comment 5 rk601 2011-10-24 15:48:58 UTC
Created attachment 52719 [details]
OSX_SVG_test

We conducted three different tests. The third test is based on SVG images.

We tested the desired functionality in the Master:

LibO-dev 3.5.0 
Build ID: f8c2d29-e8c71c5-9c6ea62-4b83b90
On OSX 10.6.8

Located at:

http://dev-builds.libreoffice.org/daily/MacOSX_10.6.7_Intel_no-moz/master/2011-10-24_13.56.07/

with

master~2011-10-24_13.56.07_LibO-Dev_OOO350m1_MacOS_x86_install_en-US.dmg

Steps to reproduce:

1. download and unzip attached test kit
2. Open "OSX_SVG_Test.odt"
3. save as "OSX_SVG_Test.rtf"
4. Open saved OSX_SVG_test.odt file
   Expected: table with pictures will be saved
   Actual: Pictures are gone and not saved

Unable to save images as RTF because the SVG images were not saved!

See attachment for sample documents and screenshots (OSX_SVG_Test.zip).
Comment 6 Rainer Bielefeld Retired 2011-10-26 11:08:30 UTC
@rk601@yahoo.com
What's the detailed result of your tests?  Can we summarize "Confirmed"?
Comment 7 Rainer Bielefeld Retired 2011-11-03 11:01:17 UTC
No objections, so due to Comment 5
Comment 8 Jean-Baptiste Faure 2011-12-18 06:41:22 UTC
I made tests on the original test kit with LO 3.5.0 beta-1 under Ubuntu 10.04 x86_64.
Pictures are in the resulting RTF file but all three pictures are in the first cell (A1) of the table. So it is better but not perfect ;-)

Best regards. JBF
Comment 9 Björn Michaelsen 2011-12-23 13:24:07 UTC
Since all new unconfirmed bugs start in state UNCONFIRMED now and old unconfirmed bugs were moved to NEEDINFO with a explanatory comment, all bugs promoted above those bug states to NEW and later are automatically confirmed making the CONFIRMED whiteboard status redundant. Thus it will be removed.
Comment 10 Ronildo Matsuura 2012-08-07 13:14:17 UTC
I am having the same problem! I'm tested v3.5.4, v.3.5.5 and v3.6.0.4rc
Comment 11 Rainer Bielefeld Retired 2012-08-07 15:44:30 UTC
<http://wiki.documentfoundation.org/BugReport_Details#Version>

@Miklós
Can you help?
Comment 12 tommy27 2013-08-31 19:18:26 UTC
saved Reiner's test file as .rft using 4.1.1.2 under Win7 64bit.

the first 2 images in the table look partially cropped when reopening the file in LibO, but they look normal in WordPad. the 3rd image looks normal both in LibO and WP.

so it seems to me that the issue is about showing the .rtf not saving (WordPad do not shows corruption of the images).
Comment 13 deathbyfreezeray 2014-04-02 01:46:27 UTC
I Can reproduce the problem on Windows 7 64-bit as well as Ubuntu 13.10 64-bit using LibreOffice 4.2.2 . It is worth noting this bug is similar to bugs 49184, 40540, and 67318. Although these errors occur with DOC and DOCX formats, I believe they could have similar causes.
Comment 14 A (Andy) 2015-04-06 19:27:35 UTC
Reproducible with LO 4.4.1.2, Win 8.1
Comment 15 Vasily Melenchuk (CIB) 2015-06-04 14:25:30 UTC
Problem is also reproduced with original testset from comment #1 and LO master: 2 of 3 images are not displayed after saving to RTF.

I've dig a little deeper here. Some additional details about problem:
1) Source images are in GIF format. It is not supported by RTF.
2) So LibreOffice converts these images to WMF (RtfAttributeOutput::FlyFrameGraphic())
3) Generated WMF images have zero values in META_SETWINDOWEXT (https://msdn.microsoft.com/en-us/library/cc250498.aspx): wmf images which can not be opened by LibreOffice later have X=0 and Y=0 in META_SETWINDOWEXT record, while third one which is displayed has X=414 Y=397.

I suppose that this is the first of the reasons why these images are not displayed by LO. 

By the way, these images are not displayed by other tools able to open WMF files (tested in Windows with Paint, Internet Explorer, Word).
Comment 16 Vasily Melenchuk (CIB) 2015-06-04 14:26:15 UTC
Created attachment 116284 [details]
Extracted WMF images from output RTF file
Comment 17 Commit Notification 2015-10-24 21:29:01 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f7c8774b2f3423095d794e90c58ab505ef8a1706

tdf#39960 fix saving of GIF images into RTF

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 tommy27 2015-10-25 06:15:20 UTC
thank you very much for fixing this ancient bug!!! thumbs up!!!
Comment 19 deathbyfreezeray 2015-10-25 06:43:50 UTC
(In reply to Commit Notification from comment #17)
> Vasily Melenchuk committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=f7c8774b2f3423095d794e90c58ab505ef8a1706
> 
> tdf#39960 fix saving of GIF images into RTF
> 
> It will be available in 5.1.0.
> 
> The patch should be included in the daily builds available at
> http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> information about daily builds can be found at:
> http://wiki.documentfoundation.org/Testing_Daily_Builds
> 
> Affected users are encouraged to test the fix and report feedback.

Thanks so much, I never thought this would get fixed.
Comment 20 tommy27 2015-10-25 07:08:42 UTC
Created attachment 119936 [details]
screenshot in LibO 5.0.3

this is the screenshot without Vasily fix
note the loss of first two images
Comment 21 tommy27 2015-10-25 07:10:37 UTC
Created attachment 119937 [details]
screenshot in LibO 5.1.0

this is the screenshot after Vasily fix
note that the images are not lost

probably we should open new bug reports about the table row size and image position

anyway the problem about image loss is gone so I set status to VERIFIED FIXED