Bug 68927 - SVG images are painted at too low resolution if used as page background
Summary: SVG images are painted at too low resolution if used as page background
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: Other All
: highest normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: BSA target:4.3.0 target:4.2.2
Keywords: bibisected, regression
Depends on:
Blocks: mab4.1
  Show dependency treegraph
 
Reported: 2013-09-04 10:58 UTC by a07cd040897db54e103c
Modified: 2015-12-17 07:30 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
case 1: chosen menu items (26.75 KB, image/png)
2013-09-04 10:58 UTC, a07cd040897db54e103c
Details
case 1: the resulting document (40.92 KB, application/vnd.oasis.opendocument.text)
2013-09-04 11:01 UTC, a07cd040897db54e103c
Details
case 1: screenshot of the result at 600% zoom (this is as it *should* be in case 2) (29.39 KB, image/png)
2013-09-04 11:03 UTC, a07cd040897db54e103c
Details
case 2: chosen menu items (18.81 KB, image/png)
2013-09-04 11:04 UTC, a07cd040897db54e103c
Details
case 2: the dialog for page background (20.27 KB, image/png)
2013-09-04 11:04 UTC, a07cd040897db54e103c
Details
case 2: the resulting document (26.65 KB, application/vnd.oasis.opendocument.text)
2013-09-04 11:05 UTC, a07cd040897db54e103c
Details
case 2: screenshot of the result at 600% zoom (this is a bitmap background, not svg) (158.05 KB, image/png)
2013-09-04 11:07 UTC, a07cd040897db54e103c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description a07cd040897db54e103c 2013-09-04 10:58:20 UTC
Created attachment 85183 [details]
case 1: chosen menu items

Problem description:

While inserting SVG-images into the normal document body (Insert -> Image -> From File), SVG-images remain vectorized (see attachments "case_1_*.*". This ist the expected behaviour.

If the SVG-image is inserted as a background image (Format -> Page -> Background; see "case_2_step1_menu.png" and "case_2_step2_dialog.png") the image seems to be converted to bitmap.

This is very annoying to us, because we are trying to migrate MS Office to LibreOffice in our company. Therefore all document templates have to be redesigned for LO, including SVG background image. At present this seems to be a show stopper for us.

Steps to reproduce:

For demonstration i used the SVG from https://wiki.documentfoundation.org/images/2/27/LibreOffice-Initial-Artwork-Logo.svg

1. Create a new Document
2. Klick Format -> Page -> Background (see "case_2_step1_menu.png")
3. Select the image in the dialog as "background" (see "case_2_step2_dialog.png")
4. Zoom in to see the difference (see "case_2_step4_result_600_screenshot.png" vs. "case_1_step3_result_600_screenshot.png")

Current behavior:

The SVG image is converted to bitmap when used as page background.

Expected behavior:

The SVG image should *stay* vectorized, no matter if inserted into the text or used as background.
Operating System: Windows XP
Version: 4.1.0.4 release
Comment 1 a07cd040897db54e103c 2013-09-04 11:01:52 UTC
Created attachment 85184 [details]
case 1: the resulting document
Comment 2 a07cd040897db54e103c 2013-09-04 11:03:10 UTC
Created attachment 85185 [details]
case 1: screenshot of the result at 600% zoom (this is as it *should* be in case 2)
Comment 3 a07cd040897db54e103c 2013-09-04 11:04:03 UTC
Created attachment 85186 [details]
case 2: chosen menu items
Comment 4 a07cd040897db54e103c 2013-09-04 11:04:40 UTC
Created attachment 85187 [details]
case 2: the dialog for page background
Comment 5 a07cd040897db54e103c 2013-09-04 11:05:09 UTC
Created attachment 85188 [details]
case 2: the resulting document
Comment 6 a07cd040897db54e103c 2013-09-04 11:07:02 UTC
Created attachment 85189 [details]
case 2: screenshot of the result at 600% zoom (this is a bitmap background, not svg)
Comment 7 a07cd040897db54e103c 2013-09-26 07:18:08 UTC
Opening the resulting odt file shows, that the SVG ist *not* CONVERTED to bitmap. The folder "Pictures" still contains the original SVG image. Nevertheless the SVG image is DISPLAYED like it was a bitmap.

Even converting to PDF does not change the way the image is displayed. The image still seems like bitmap although the size of the resulting pdf is very small, so that it can *not* really be a a bitmap.

So i conclude that the problem is the way LO *displays* the image not the way it is *stored*.
Comment 8 a07cd040897db54e103c 2013-09-26 14:54:30 UTC
Added reference to a similar but RESOLVED bugreport (https://bugs.freedesktop.org/show_bug.cgi?id=42092). There is mentioned, that the bug was resolved in LO v3.4.5, so i tested this behaviour with v3.4.5.

And guess what: SVGs in background are rendered *correctly* and even exporting them to PDF keeps them vectorized.

So the unwanted behaviour must have been reintroduced in a later version, probably v3.5.2 RC1 (https://bugs.freedesktop.org/show_bug.cgi?id=42092#c13).
Comment 9 Ivan Wagner 2013-10-01 15:24:25 UTC
I'm facing the same exact problem. Is there any plan to fix the bug?
Comment 10 Terrence Enger 2013-10-02 02:00:58 UTC
From the 40+ bibisect:

    6f88378e2e8e511345129dcc0e51fa8b184d9baa is the first bad commit
    ...
        source-hash-d43ae957000d20e34447501341b45a07b467fddc

and from `git bisect log`:

    # bad: [4118d739dbd71e16057ea926ef3ef696025d3b67] source-hash-5bd6a5110bb812f82a81e73422a7b14851f84441
    # good: [3e7462bd65e692bf0592d5b080b7716341b62a47] source-hash-1eddfce9894fd05315173744f495619189093dc7
    git bisect start 'latest' 'oldest'
    # bad: [086c82fbd0a50dbf5dd28e8bcc7a6d702cea124e] source-hash-c74f2edfce221960fe546e88f2b3222d69d53598
    git bisect bad 086c82fbd0a50dbf5dd28e8bcc7a6d702cea124e
    # good: [3367a5f4f0d1768c35ed32ac1956abf5c3ab4e0d] source-hash-cc9cd7af3beb13eede23c6c60506c6e8c329e29d
    git bisect good 3367a5f4f0d1768c35ed32ac1956abf5c3ab4e0d
    # good: [8609688fe6682504b3e6bc675e209db988d3acc1] source-hash-de69091d34d8102c0b56194d603ed9e66699d34c
    git bisect good 8609688fe6682504b3e6bc675e209db988d3acc1
    # bad: [097f48474f65f91045b392f1508d6c9b70ef8045] source-hash-5879775875cd769bca29ca87e758c13e34a7ff00
    git bisect bad 097f48474f65f91045b392f1508d6c9b70ef8045
    # good: [acdb7a89f2852097e4c6fd6e76aa751879f0b2f5] source-hash-1748c6896cfa96f5cfbe090df9f9bbf347848dd6
    git bisect good acdb7a89f2852097e4c6fd6e76aa751879f0b2f5
    # bad: [69a370f0c4edb31a4ecf7240efdab972c9388dda] source-hash-4c99fc562d02fe56ac9ffd5cec892d7c6a8fb609
    git bisect bad 69a370f0c4edb31a4ecf7240efdab972c9388dda
    # good: [2c1b315fb09c92090d1dd26c031b4acc75516765] source-hash-e799a47983c6e9f0ff312124ebf8fbea1e336b66
    git bisect good 2c1b315fb09c92090d1dd26c031b4acc75516765
    # bad: [d1871cc1c13ead91f63f078c3ad79550dc182e89] source-hash-f98e321698cd26fbb32078bf24002bd2bbafb1cb
    git bisect bad d1871cc1c13ead91f63f078c3ad79550dc182e89
    # bad: [6f88378e2e8e511345129dcc0e51fa8b184d9baa] source-hash-d43ae957000d20e34447501341b45a07b467fddc
    git bisect bad 6f88378e2e8e511345129dcc0e51fa8b184d9baa
Comment 11 Rob Snelders 2013-10-03 19:16:19 UTC
I see it has been confirmed in comment 10.

The problem doesn't effect a lot of users at their daily work. So not a major issue.
Comment 12 Lance Haverkamp 2013-10-04 03:18:01 UTC
(In reply to comment #11)
> I see it has been confirmed in comment 10.
> 
> The problem doesn't effect a lot of users at their daily work. So not a
> major issue.

I guess that depends how you use LibreOffice, now doesn't it.  No, it has little effect on IT people & students writing homework.  But for those of use who do a lot of graphics, like newsletters, advertising, flyers, client presentations, etc.; this is an annoyance that's be resurrected far too many times.  I think SVG handling has been re-broken every time someone has looked at graphics since OOo 3.3.
Comment 13 ape 2013-10-04 14:26:55 UTC
I think that is the Bug 62461
Comment 14 a07cd040897db54e103c 2013-10-07 07:54:49 UTC
(In reply to https://bugs.freedesktop.org/show_bug.cgi?id=68927#c13)

I think this is *not* the same bug as in https://bugs.freedesktop.org/show_bug.cgi?id=62461.

There is mentioned that the problem discussed in 62461 works fine in LO v3.6.5.

Tested this bug (68927) with LO v3.6.5.2 (http://downloadarchive.documentfoundation.org/libreoffice/old/3.6.5.2/win/x86/LibO_3.6.5.2_Win_x86_install_multi.msi) and the problem can also be reproduced (image is *still* rasterized). So two conclusions can be made:

1. this bug (68927) must have been reintroduced in a version > 3.4.5 and <= 3.6.5.2
2. the bugs 68927 and 62461 can *not* be the same
Comment 15 Danny 2013-11-12 21:32:39 UTC
hmm. Interestingly background images actually seem not to be secretly converted to png in 4.x, but they do seem to be displayed as such.

However, for what it is worth, I cannot reproduce this with

3.6.7.2 on Linux (fc18). It looks exactly as it should (tried another svg that triggers small rendering errors and they are also visible, so I am pretty sure I see the actual vector image). Will report if I can reproduce with 4.x later.
Comment 16 Björn Michaelsen 2014-01-17 09:51:48 UTC
(This is an automated message.)

Setting priority to highest as this is a 4.1 MAB. This is part of an effort to make the importance of MAB reflected in priority too.
Comment 17 Michael Stahl (allotropia) 2014-02-14 21:49:22 UTC
regression from commit a1a0830d1ac3ffabbe35bd8a0264b64f1f7a9d67,
which fixed a wrong conversion constant and thereby exposed
that this was only "working" by accident before...

fixed on master, but it's too risky to backport to 4.1 branch which is
missing some prerequisites.
Comment 18 Commit Notification 2014-02-14 21:50:09 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

fdo#68927: sw: fix painting of SVG page background



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 19 Jean-Baptiste Faure 2014-02-15 21:44:40 UTC
(In reply to comment #17)
> [...]
> fixed on master, but it's too risky to backport to 4.1 branch which is
> missing some prerequisites.

Is there the same kind of risk for the 4.2 branch ?

Best regards. JBF
Comment 20 Commit Notification 2014-02-17 09:56:55 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=884aa71132efe05aed456a5ca0cfd69ca148939f&h=libreoffice-4-2

fdo#68927: sw: fix painting of SVG page background


It will be available in LibreOffice 4.2.2.

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 21 Commit Notification 2014-02-18 13:05:47 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=478e481e36add5c34788b718ef7a4b9dc4744424&h=libreoffice-4-2-1

fdo#68927: sw: fix painting of SVG page background


It will be available already in LibreOffice 4.2.1.

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 22 Michael Stahl (allotropia) 2014-02-21 10:45:08 UTC
correcting target, since 4.2.1.1 is 4.2.1 release
Comment 23 Robinson Tryon (qubit) 2015-12-17 07:30:13 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]