Bug 98275 - PNG image with alpha channel pasted from clipboard has black background
Summary: PNG image with alpha channel pasted from clipboard has black background
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All Windows (All)
: high normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 119705 133729 (view as bug list)
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2016-02-29 15:42 UTC by ivana.bosnic
Modified: 2023-11-06 15:13 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
pasted transparent image (106.61 KB, image/jpeg)
2016-02-29 15:42 UTC, ivana.bosnic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ivana.bosnic 2016-02-29 15:42:02 UTC
Created attachment 123079 [details]
pasted transparent image

Pasting (NOT inserting) PNG image with transparent alpha channel displays the image with a black background, instead of a transparent one. 

This seems identical to bug 33114, https://bugs.documentfoundation.org/show_bug.cgi?id=33114, but I was advised there to submit a new bug, as that one was fixed. From the explanations there, it seems only the bitmap version can be pasted from the clipboard in any LO tool, not the PNG one. 

Steps to reproduce:
1. Open https://en.wikipedia.org/wiki/File:PNG_transparency_demonstration_1.png in any browser (tried with FF/Chrome/IE).
2. Copy the image.
3. Paste the image into any LO program. The image appears with black background, instead of a transparent one.

If the image is saved and then inserted (instead of pasted), all is fine, and the background is transparent.

I'm quite sure this was present in versions earlier than LO 5, I could try it with the older versions, but that bug 33114, fixed in 4.2, confuses me.
Comment 1 Julien Nabet 2016-02-29 18:33:26 UTC
On pc Debian x86-64 with LO Debian package 5.0.5.2 or with master sources updated yesterday, I don't reproduce this.
Windows only bug?
Comment 2 Stéphane Guillou (stragu) 2016-03-01 00:02:12 UTC
Not able to reproduce either on KXStudio 14.04 with:

LibreOffice Version: 5.0.5.2
Build ID: 1:5.0.5~rc2-0ubuntu1~trusty1
Locale: en-GB (en_GB.UTF-8)

Image copied from Firefox 44.0.2
Comment 3 Tomislav 2016-03-01 15:02:57 UTC
Tried on Win 8.1, with LO 5.0.1.2. Bug is present.
Comment 4 Buovjaga 2016-03-09 10:33:23 UTC
Repro.
3.5: paste special - bitmap.

Win 7 Pro 64-bit, Version: 5.1.0.3 (x64)
Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI)

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 5 Telesto 2016-12-03 19:59:56 UTC
Confirming with:
Version: 5.4.0.0.alpha0+
Build ID: 33f5bc54aaa7fe7aa9335726e30f9c349155e04d
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-12-01_23:21:05
Locale: nl-NL (nl_NL); Calc: CL
Comment 6 Hans Deragon 2017-06-14 01:18:35 UTC
I reproduce the problem easily under Windows 10 with LibreOffice writer 5.3.3.2 by copying directly from Chrome the following image https://git-scm.com/images/logos/downloads/Git-Logo-2Color.png into a plain new document.

This problem only occurs under Windows.  On Linux Ubuntu 16.04 LTS, LibreOffice writer 5.3.3.2, the problem does not occur.
Comment 7 QA Administrators 2018-06-15 02:45:19 UTC Comment hidden (obsolete)
Comment 8 ivana.bosnic 2018-06-15 15:27:35 UTC
The bug is still present, unfortunately. :( 

Version: 6.0.1.1 (x64)
Build ID: 60bfb1526849283ce2491346ed2aa51c465abfe6
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: hr-HR (hr_HR); Calc: CL
Comment 9 boicottms 2019-03-10 17:06:38 UTC
I suffer of this bug too
Win 10/64, liboo  6.2.0.3 (x64)
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
Pasting any image from wikipedia (from firefox or chrome) to impress, for exhample this:
https://upload.wikimedia.org/wikipedia/commons/thumb/2/28/Christ_Church_Cathedral_Dublin_-_Plan.svg/640px-Christ_Church_Cathedral_Dublin_-_Plan.svg.png
Comment 10 Julien Nabet 2019-03-14 10:29:20 UTC
On Win 10 with LO 6.1.5.2 x64 + GL render + Calc CL, here are my results:

with https://en.wikipedia.org/wiki/File:PNG_transparency_demonstration_1.png
and https://upload.wikimedia.org/wikipedia/commons/thumb/2/28/Christ_Church_Cathedral_Dublin_-_Plan.svg/640px-Christ_Church_Cathedral_Dublin_-_Plan.svg.png
- Impress + Draw: reproduced
- Writer: not reproduced
- Calc: with Paste special bitmap, reproduced

Idem with master sources updated yesterday on Win10.

Remark: if on Writer, I use paste special/bitmap, I could reproduce this too.

Tomaz: having noticed your work on VCL rendering, thought you might be interested in this one.
Comment 11 Xisco Faulí 2019-03-18 19:18:13 UTC
*** Bug 119705 has been marked as a duplicate of this bug. ***
Comment 12 Jun Nogata 2020-08-22 20:58:18 UTC
Writer is good, but Reproduce Draw/Impress/Calc.

- Writer: Good (background is transparent)
- Draw/Impress: Bad (background is black)
- Calc: from Chrome 84.0.4147.135 / Bad (background is black)
        from Firefox 79.0 / Can't paste Image... Why?

Steps to reproduce:
1. Open the following URL from web browser(Firefox or Chrome).
https://1.bp.blogspot.com/-3nzUHu2AP3c/Xx-0ffvXGJI/AAAAAAABaWU/WjGBzNs82ZUIqCT-EmLxtopmazY3Z6ecACNcBGAsYHQ/s1600/mask_karamaru_megane_earphone.png
2. Copy the image.
3. Paste Writer/Calc/Impress/Draw

Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU threads: 2; OS:Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded
Comment 13 Roman Kuznetsov 2021-03-13 11:21:09 UTC
Still repro for Impress in

Version: 7.2.0.0.alpha0+ (x86) / LibreOffice Community
Build ID: 3faaad6d16881dbbd70e34dcb0445a3373f8ddad
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 14 Buovjaga 2021-03-17 07:39:02 UTC
*** Bug 133729 has been marked as a duplicate of this bug. ***
Comment 15 Timur 2022-05-18 08:59:16 UTC
There's a different example here, given in bug 134031, embarrassing one. 
LO TDF log PNG from TDF page www.documentfoundation.org copied from Firefox with "Copy Image" won't paste to Calc, wrong in Writer, not same in Draw 
I set this to High.
Comment 16 Paris Oplopoios 2023-06-10 18:54:58 UTC
Could not reproduce in Writer, Calc, Impress or Draw in latest master (LibreOfficeDev 24.2.0.0.alpha0 4ceac7d67d3f3e09dc3f4a03b330d779e6a71e4c). Probably because we switched to using libpng some time during summer of 2022. Would be cool if someone else could confirm this is no longer a bug.
Comment 17 ivana.bosnic 2023-11-06 14:16:24 UTC
As the original reporter, I confirm that in my LO Impress on Windows the bug is still present, in version 7.6.2.1, with the same steps to reproduce as in the first post. 

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: hr-HR (hr_HR); UI: en-US
Calc: threaded
Comment 18 ivana.bosnic 2023-11-06 14:21:11 UTC
Huh, update: 

While the original bug report concerned copying from three browsers, FF/Chrome/IE, I can now reproduce it only with copying from Firefox. 

Copying from Chrome and Edge do paste the transparent image. 

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: hr-HR (hr_HR); UI: en-US
Calc: threaded
Comment 19 Julien Nabet 2023-11-06 15:13:43 UTC
Noel: thought you might be interested in this one since it concerns alpha channel management.