Bug 115843 - HiDPI images in LibreOffice Writer are blurry with GTK3 backend
Summary: HiDPI images in LibreOffice Writer are blurry with GTK3 backend
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.3.0 target:6.2.4
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2018-02-19 09:47 UTC by Keith Curtis
Modified: 2021-05-02 02:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document with big image (256.66 KB, application/vnd.oasis.opendocument.text)
2018-02-19 09:48 UTC, Keith Curtis
Details
Blurry LibreOffice image in screenshot (651.17 KB, image/png)
2018-02-19 09:49 UTC, Keith Curtis
Details
Screenshot with crisp original image on top. (503.92 KB, image/png)
2018-02-19 09:50 UTC, Keith Curtis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Curtis 2018-02-19 09:47:27 UTC
Description:
Insert a hi-res HiDPI image into LibreOffice Writer. Image is blurrier than it should be. Note, if I insert it into Calc or Draw, it looks great.

Steps to Reproduce:
Insert HiDPI image such as in attached document


Actual Results:  
Image is blurrier than it should be

Expected Results:
Image should be just as crisp as the original screenshot scaled down to the same size.


Reproducible: Always


User Profile Reset: No



Additional Info:
Standard Arch Linux Gnome 3 


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 Keith Curtis 2018-02-19 09:48:29 UTC
Created attachment 139986 [details]
Sample document with big image
Comment 2 Keith Curtis 2018-02-19 09:49:44 UTC
Created attachment 139987 [details]
Blurry LibreOffice image in screenshot
Comment 3 Keith Curtis 2018-02-19 09:50:49 UTC
Created attachment 139988 [details]
Screenshot with crisp original image on top.
Comment 4 Buovjaga 2018-03-07 11:15:36 UTC
Repro, but only with GTK3

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: 856c57f20f9b07c686a854e0ccbb6ee3b0ee4791
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 7th 2018
Comment 5 Keith Curtis 2018-03-26 22:27:59 UTC
I tried it out on KDE / Plasma and also noticed that high-res bitmaps look better there.
Comment 6 QA Administrators 2019-03-27 03:39:40 UTC Comment hidden (obsolete)
Comment 7 Keith Curtis 2019-03-27 08:29:08 UTC
Yes, this still reproduces in LibreOffice 6.2.2.2
Comment 8 Babak Razmjoo 2019-03-27 10:38:43 UTC
This bug is no longer reproducible in
Version: 6.2.0.3
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU threads: 1; OS: Linux 5.0; UI render: default; VCL: x11; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Changing status to RESOLVED WORKSFORME
Comment 9 Buovjaga 2019-03-27 11:22:11 UTC
(In reply to Babak Razmjoo from comment #8)
> This bug is no longer reproducible in
> Version: 6.2.0.3
> Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
> CPU threads: 1; OS: Linux 5.0; UI render: default; VCL: x11; 
> Locale: en-US (en_US.UTF-8); UI-Language: en-US
> Calc: threaded
> Changing status to RESOLVED WORKSFORME

You are running without any particular VCL backend (x11). You should test with gtk3.
Comment 10 Caolán McNamara 2019-03-28 21:10:37 UTC
I imagine we've scaled the image down and then upscaled that result up back again
Comment 11 Caolán McNamara 2019-03-29 11:58:25 UTC
The problem is in drawinglayer/source/processor2d/vclhelperbufferdevice.cxx impBufferDevice::paint where the HiDpi-supporting OutputDevices are mergeded together to form a bitmapex (non-hidpi) and then blitted the final outputdevice so gets blurry as it goes through a bitmapex
Comment 12 Caolán McNamara 2019-03-29 14:37:13 UTC
I think for this common case we can avoid the transparent outputdevice thing, though for the general case we need a different approach or to allow outputdevices to be combined directly without intermediate bitmaps
Comment 13 Commit Notification 2019-03-29 19:19:57 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/b1f961e3a459d2772f12da556ab74fa635d6a46a%5E%21

tdf#115843 avoid using transparent virtualdevice when 100% opaque

It will be available in 6.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 14 Caolán McNamara 2019-04-02 13:33:57 UTC
presumably there exists some edge cases where it can appear, but for the normal experience the above seems sufficient to avoid this problem
Comment 15 Commit Notification 2019-04-18 10:28:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/6affe1576e34d6bc111d1db38416492375fd5fcc%5E%21

tdf#115843 avoid using transparent virtualdevice when 100% opaque

It will be available in 6.2.4.

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

Affected users are encouraged to test the fix and report feedback.