Bug Hunting Session
Bug 90070 - Adding a border and spacing to content shrinks the size on an image
Summary: Adding a border and spacing to content shrinks the size on an image
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 90071 95475 (view as bug list)
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2015-03-17 19:23 UTC by Yousuf Philips (jay) (retired)
Modified: 2019-01-11 20:36 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
sample docx (24.81 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-04-17 10:46 UTC, Yousuf Philips (jay) (retired)
Details
imagePadding.odt - image with border and padding (17.51 KB, application/vnd.oasis.opendocument.text)
2016-11-04 18:12 UTC, Justin L
Details
ImageBorder.doc: 2page MSO2003 doc testing image with border spacing (36.00 KB, application/msword)
2016-11-18 16:18 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-03-17 19:23:04 UTC
Steps:
1) Open Writer
2) Insert an image
3) Resize the image so its not taking up the entire width of the page
4) Format > Image...
5) Set a border
6) Notice that rather than putting a border and spacing between the image and border, the image is shrunk to accomodate the border and spacing within the area of the image.

Version: 4.5.0.0.alpha0+
Build ID: de145fb467f2a168261915d63b47d3cd3b03d732
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2015-03-15_09:51:29
Comment 1 A (Andy) 2015-03-17 19:31:51 UTC
*** Bug 90071 has been marked as a duplicate of this bug. ***
Comment 2 A (Andy) 2015-03-17 19:36:01 UTC
Reproducible with LO 4.4.1.2, Win 8.1
Comment 3 Yousuf Philips (jay) (retired) 2015-03-17 21:08:17 UTC
Thanks Andy for noticing that it submitted it twice. Bugzilla has been acting up lately.
Comment 4 Yousuf Philips (jay) (retired) 2015-04-17 10:17:01 UTC
So it seem this not only affects images, it also affects OLE objects like charts, and it also effects compatibility.
Comment 5 Yousuf Philips (jay) (retired) 2015-04-17 10:46:50 UTC
Created attachment 114855 [details]
sample docx

Attached is an example docx file, which when opened in LO results in the image being cropped to give place to the borders.
Comment 6 Yousuf Philips (jay) (retired) 2015-04-17 12:58:53 UTC
Kendy asked me to CC you on this. :D
Comment 7 Justin L 2016-11-04 18:12:38 UTC
Created attachment 128498 [details]
imagePadding.odt - image with border and padding

This is not inherited from OOo, but is a regression between 3.6 and 4.0 somewhere between
bad commit b679a2a02180c017bd8b596fb2e4f283bad93b75
    Author:     Noel Grandin <noel@peralex.com>
    CommitDate: Wed Sep 5 15:46:55 2012 +0200
        fdo#46808, Adapt reflection::CoreReflection UNO service to new style

and good: commit 7dd6c0a8372810f48e6bee35a11ac4ad0432640b
    Author:     Noel Grandin <noel@peralex.com>
    CommitDate: Mon Sep 3 15:55:05 2012 +0200
        Remove some unnecessary includes from the IDL files

and almost certainly due to this commit e598ab04476a32a08f18e8f0662fafa5f78f1a4a
  author Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> 2012-09-04 10:59:52
  n#775270: clip pictures instead of scaling they don't fit
Comment 8 Justin L 2016-11-05 10:17:04 UTC
proposed fix: https://gerrit.libreoffice.org/30585 tdf#90070 don't clip flys with borders
Comment 9 Commit Notification 2016-11-05 17:03:05 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#90070 don't clip flys with borders

It will be available in 5.3.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 2016-11-07 15:59:56 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ab64ae2a828f4acd6d118abc14193c543d04b940&h=libreoffice-5-2

tdf#90070 don't clip flys with borders

It will be available in 5.2.4.

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 Yousuf Philips (jay) (retired) 2016-11-07 18:46:01 UTC
Hi Justin,

Your fix fixes the regression introduced in 4.0 relative to your attachment 128498 [details], but doesnt resolve the OOo inherited issue mentioned in the description or in attachment 114855 [details].
Comment 12 Justin L 2016-11-18 16:18:03 UTC
Created attachment 128848 [details]
ImageBorder.doc: 2page MSO2003 doc testing image with border spacing

It appears that Writer's scale-down-the-image-to-add-a-border is different from MSWord, which enlarges-the-frame-to-accommodate-the-border. (This test document drops down to one page in Word when the border is removed, but Writer just scales up the image to fill the empty space.)  This doesn't seem to affect interoperability - both open the saved document identically. The patch in comment 9 addresses the cropping issue (where the image is cut off by the border) but not the avoid-scaling enhancement requested in the description.

Removing myself from the bug along with any indicators that the bug has been fixed.
Comment 13 Aron Budea 2016-11-20 02:18:13 UTC
*** Bug 95475 has been marked as a duplicate of this bug. ***
Comment 14 tommy27 2017-02-18 14:47:52 UTC
still present in LibO 5.4.0.0.alpha0+
Build ID: 5bb5a9dacb84ec14f7148a5a5d9ba38b7e9f1039
CPU Threads: 4; OS Version: Windows 6.29; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-02-17_23:30:45
Locale: it-IT (it_IT); Calc: group
Comment 15 QA Administrators 2018-02-19 03:34:28 UTC Comment hidden (obsolete)
Comment 16 Regina Henschel 2018-05-26 12:54:02 UTC
The error still exists in Version: 6.2.0.0.alpha0+ (x64)
Build ID: f7f2d03bd6f5aa5dcd0f7976b4a7f2db278c2f03
CPU threads: 8; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-05-25_05:00:28
Locale: de-DE (de_DE); Calc: CL

The problem is, that the image is imported as Writer-image, but it needs to be a Draw-image for to get the same "border" as in docx. In fact it is not a border but a line.
Comment 17 Regina Henschel 2018-05-26 13:08:54 UTC
The error exists too, if a border is added to an Writer-image. With the current implementation, the size would need to be increased by the 2 x border width.
Comment 18 Heiko Tietze 2018-12-20 16:07:52 UTC
I vote for WFM since adding a border to the outer space changes the text flow.
Comment 19 Aron Budea 2018-12-20 16:34:47 UTC
Would adding a setting whether to add the border inside, outside or centered be a reasonable compromise?
Comment 20 Xisco Faulí 2019-01-11 20:36:10 UTC
Lowering importance: Highest + Inherit from OOo doesn't make much sense at this point anymore...