Bug 49893

Summary: FILEOPEN: RTF: Image in header not displayed
Product: LibreOffice Reporter: Jesus Corrius <jesus>
Component: WriterAssignee: Gabor Kelemen (allotropia) <kelemeng>
Status: ASSIGNED ---    
Severity: normal CC: alexpikptz, aron.budea, dennisroczek, gbpacheco, kelemeng, robinson.libreoffice, vasily.melenchuk, vmiklos, xiscofauli
Priority: medium Keywords: bibisected, bisected, filter:rtf, regression
Version: Master old -3.6   
Hardware: Other   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=127806
https://bugs.documentfoundation.org/show_bug.cgi?id=96275
https://bugs.documentfoundation.org/show_bug.cgi?id=149238
https://bugs.documentfoundation.org/show_bug.cgi?id=148558
Whiteboard: BSA target:5.0.0 target:5.1.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 113365    
Attachments: RTF document with the broken table
Screenshot of the document viewed in Microsoft Word Viewer
Screenshot of the document opened in LibreOffice
Shape with picture, no extra groups
Shape with picture, extra RTF groups inside shape
The example file in Word and Writer master
The example file in Word and Writer master - shape

Description Jesus Corrius 2012-05-14 01:59:39 UTC
Created attachment 61597 [details]
RTF document with the broken table

Problem description: 

Steps to reproduce:
1. Launch LibreOffice master
2. Open the attached document

Current behavior:

The table in the document doesn't look as it should.

Expected behavior:

The document looks exactly as in Microsoft Office.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727)
Comment 1 Jesus Corrius 2012-05-14 02:01:09 UTC
Created attachment 61598 [details]
Screenshot of the document viewed in Microsoft Word Viewer
Comment 2 Jesus Corrius 2012-05-14 02:01:52 UTC
Created attachment 61599 [details]
Screenshot of the document opened in LibreOffice
Comment 3 s-joyemusequna 2012-05-14 04:08:24 UTC
Confirmed with LOdev 3.6 (master - 14-May-2012 02h55 x86@6-fast; Build ID: 347e345). No regression though, was even worse with LibO 3.3.4 and 3.4.5. Tested with Windows Vista 64 and XP.
Comment 4 Julien Nabet 2013-06-23 12:31:28 UTC
It's better with 4.0.3 or with master sources (future 4.2.0).
The only thing I noticed is the content of the two first columns are no center aligned vertically.
Comment 5 Alexandr 2014-08-06 08:58:05 UTC
In LibreOffice 4.2.5 and 4.3.0 on Debian I see 3 issues:
1) the content of the two first columns are no center aligned vertically as it said in comment 4;
2) black rectangle in left top corner of the table instead of a picture;
3) no margins in the cells
Comment 6 Vasily Melenchuk (CIB) 2015-02-10 12:13:56 UTC
(In reply to Alexandr from comment #5)
> In LibreOffice 4.2.5 and 4.3.0 on Debian I see 3 issues:
> 2) black rectangle in left top corner of the table instead of a picture;

Partial fix for problem 2 (blank rectangle instead a picture) was pushed to gerrit (https://gerrit.libreoffice.org/#/c/14396/)

There are several reasons of this problem:
1) FIXED: "pib" object in shape was skipped while detected shape type was #1 (rectangle), but RTF parses pib only for shape type #74 (picture frame). As far as I see in MS Word and from RTF specification, there are no limitations on pib object usage: it is drawn always, not depending on shape type.

2) FIXED: size of "pib" picture: it looks like image should be stretched to fit shape area.

3) NOT FIXED: strange lines on top left of shape. reason of this behavior lies in extra grouping in shape, so one shape object is treated as 2 objects: one frame with wrong dimensions (black lines to top and to left) and shape with pib (picture). Looks like this must be fixed in general RTF parser.
Comment 7 Vasily Melenchuk (CIB) 2015-02-10 12:14:53 UTC
Created attachment 113287 [details]
Shape with picture, no extra groups
Comment 8 Vasily Melenchuk (CIB) 2015-02-10 12:15:30 UTC
Created attachment 113288 [details]
Shape with picture, extra RTF groups inside shape
Comment 9 Commit Notification 2015-03-08 13:13:57 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

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

tdf#49893: fix for missing header on page 2

It will be available in 4.5.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 10 Commit Notification 2015-07-28 08:21:19 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

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

tdf#49893: final fix for blank rectangle problem

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 11 Robinson Tryon (qubit) 2015-12-14 11:26:31 UTC Comment hidden (obsolete)
Comment 12 Xisco Faulí 2016-09-15 22:26:39 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 13 Dennis Roczek 2016-09-17 12:18:16 UTC
no. problem still persists that the header with the image is not displayed (see image of word viewer)

tested with:
Version: 5.2.1.2 (x64)
Build-ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU-Threads: 4; BS-Version: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group
Comment 14 Xisco Faulí 2017-07-13 09:21:40 UTC
Setting Assignee back to default. Please change it back if you're still working on this issue
Comment 15 Alexandr 2017-10-21 18:43:09 UTC
The picture in the original document is not visible in LibreOffice 5.2.7 and 6.0.0.0.alpha1 on Debian Jessie. Vertical alignment in the first 2 columns is broken too.

The picture is visible in the last 2 simple documents.
Comment 16 QA Administrators 2018-10-23 02:48:50 UTC Comment hidden (obsolete)
Comment 17 Jinpo 2019-09-27 05:46:49 UTC
problem still persists that the header with the image is not displayed.

LibreOffice info:
版本: 6.3.1.2 (x64)
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
CPU 线程: 4; 操作系统: Windows 10.0; UI 渲染: 默认; VCL: win; 
区域语言: zh-CN (zh_CN); UI 语言: zh-CN
Calc: threaded
Comment 18 QA Administrators 2021-09-30 04:02:23 UTC Comment hidden (obsolete)
Comment 19 Gabor Kelemen (allotropia) 2022-01-25 11:24:24 UTC
Created attachment 177767 [details]
The example file in Word and Writer master

Still a problem in 

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 86a9c860410351125708543c1050bfc0977d3b97
CPU threads: 13; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

The image is imported as a very small image, so invisible.
Comment 20 Gabor Kelemen (allotropia) 2022-01-25 11:28:39 UTC
Created attachment 177768 [details]
The example file in Word and Writer master - shape

The image falls apart into a small image and a correctly sized empty shape.
This was correct in 5.1.
Comment 21 Gabor Kelemen (allotropia) 2022-01-25 13:13:59 UTC
This seem to have regressed shortly after being fixed in 5.1 (see comment #10) in 5.2 with:

https://git.libreoffice.org/core/+/015fd55c94b7b650ed8e572cafaf3b0f903b01b9

author	Miklos Vajna <vmiklos@collabora.co.uk>	Tue May 10 09:16:17 2016 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	Tue May 10 10:33:41 2016 +0000

tdf#96275 RTF import: fix anchor of shapes inside tables

Adding CC to: Miklos Vajna
Comment 22 Mike Kaganski 2022-05-23 08:13:38 UTC
(In reply to Vasily Melenchuk (CIB) from comment #8)
> Created attachment 113288 [details]

FTR, sw/qa/extras/rtfimport/data/fdo49893-3.rtf from commit 611d8ee6fe141f9af39c76a864b365d57776db10 is flagged by Defender as CVE-2010-3333 [1], which is OK, and indeed testing it for not causing any overflows is useful. (Mentioning because of tdf#149238.)

See also Virustotal detection [2].

[1] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3333
[2] https://www.virustotal.com/gui/file/a73637b479b306648325901dda6e9b78d0876e17837a191cd69cc8525560ed65
Comment 23 Miklos Vajna 2023-11-06 10:54:39 UTC
This is assigned already, so removing it from my dashboard.