Bug 33114 - pasting picture with alpha channel
Summary: pasting picture with alpha channel
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.0 RC3
Hardware: All All
: highest normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 33346 36097 36098 38434 41804 47856 56751 70996 (view as bug list)
Depends on:
Blocks: mab4.1
  Show dependency treegraph
 
Reported: 2011-01-14 08:08 UTC by young p.
Modified: 2016-02-29 16:10 UTC (History)
15 users (show)

See Also:
Crash report or crash signature:


Attachments
1 page ppt file with a figure(has alpha channel) (71.13 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2011-01-14 08:08 UTC, young p.
Details
picture with transparent middle to demonstrate problem with transparency (352 bytes, image/png)
2011-02-21 07:23 UTC, sasha.libreoffice
Details

Note You need to log in before you can comment on or make changes to this bug.
Description young p. 2011-01-14 08:08:52 UTC
Created attachment 42037 [details]
1 page ppt file with a figure(has alpha channel)

when a figure made by GIMP2.6 with transparent channel copied and pasted onto writer, the transparent part appears as black.

If the same figure was pasted onto the MSOffice2010 pp or word, it appears fine.

When the pasted figure in MSOffice file copied and put into LibO3.3 RC3(and RC2) writer, the program stops and exits.

I attached the pptx format file I pasted from GIMP2.6.
Comment 1 sasha.libreoffice 2011-02-21 07:23:20 UTC
Created attachment 43601 [details]
picture with transparent middle to demonstrate problem with transparency

I have generated small picture to demonstrate this problem. When I add picture to writer or Draw by Insert->Picture->From File it is ok. But when directly from Gimp, thet black square in middle of picture. On windows 32 the same problem as in Linux 64.
Comment 2 Björn Michaelsen 2011-12-23 11:48:02 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Pedro 2012-01-07 06:15:10 UTC
I can confirm that pasting an image with a Transparent part it will loose transparency.

This is not unexpected since the only option available in Paste As is Bitmap so I assume that using simple Paste will use the only option available. A Bitmap doesn't have alpha channels...

This is a limitation of the way LO handles the Windows clipboard.

When pasting the same image in MS Office with Paste As in addition to Bitmap you get Picture (PNG), which is selected by default, and Device Independent Bitmap.

This feature is quite important when transferring images using the clipboard.
Comment 4 sasha.libreoffice 2012-01-17 05:01:36 UTC
reproduced on LibO 3.5.0 beta 2 on Fedora 64 bit
IMHO LibreOffice saves all pasted in clipboard images as JPEG images
workaround at this time is: save image as file in Gimp and then insert this file into LibreOffice
Comment 5 Sebastian Held 2012-01-24 13:16:27 UTC
*** Bug 41804 has been marked as a duplicate of this bug. ***
Comment 6 Sebastian Held 2012-01-24 13:18:00 UTC
*** Bug 36097 has been marked as a duplicate of this bug. ***
Comment 7 Sebastian Held 2012-01-24 13:19:12 UTC
*** Bug 36098 has been marked as a duplicate of this bug. ***
Comment 8 Sebastian Held 2012-01-24 13:20:16 UTC
*** Bug 38434 has been marked as a duplicate of this bug. ***
Comment 9 Sebastian Held 2012-01-24 13:28:51 UTC
*** Bug 33346 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Held 2012-01-24 13:40:39 UTC
The clipboard code responsible for pasting into a document needs some rework. It currently only accepts images with mime type "image/bmp" (Bitmap). It should accept the same image formats it can import by using the standard "insert image from file" command.
Comment 11 Florian Reisinger 2012-03-25 06:34:03 UTC
Working with 3.4.4 on Ubuntu 11.04
Comment 12 Felix Möller 2012-03-25 07:35:10 UTC
My bug #33346, which is a duplicate of this can still be reproduced with lo 3.5.1 on Ubuntu 11.10
Comment 13 sasha.libreoffice 2012-03-26 01:02:22 UTC
reproduced in 3.5.1 on Fedora 64 bit, so Reopened
Comment 14 bfoman (inactive) 2012-07-03 02:50:00 UTC
*** Bug 47856 has been marked as a duplicate of this bug. ***
Comment 15 Dave Richards 2012-07-25 17:46:49 UTC
Tested and still broken in 3.6RC.  This is one of the last really clunky old OpenOffice nuances still hanging with us.  Not being able to paste an image with an alpha channel forces the users to save the file first and then insert it into Libreoffice.
Comment 16 sasha.libreoffice 2012-07-27 14:45:55 UTC
Thanks for additional testing
"Version" is most old version of program where bug appears. Not current version.
Changing back to 3.3.0 RC3
Comment 17 Stéphane Guillou (stragu) 2012-10-09 02:02:33 UTC
I am using LO 3.6.0.2 on Ubuntu 12.04 and I don't seem to be able to reproduce this (two different png files with alpha channel tested), even though I remember it was my most hated bug a while ago.
Can anyone try this again with the 3.6 series?
Comment 18 Callegar 2012-10-09 08:09:37 UTC
Bug is still there as of 3.6.2.

1) Open libreoffice draw
2) Open a web browser
3) With the web browser, go to https://en.wikipedia.org/w/index.php?title=File:Ohm%27s_Law_with_Voltage_source.svg&page=1
The figure that shows on the browser has an alpha channel
4) Copy it
5) Back to libreoffice. Paste the image. You get a black box instead of the image.

If at point 5 you select Paste as special, you can see that the only option relevant to images is bitmap (see comment 10).
Comment 19 Stéphane Guillou (stragu) 2012-10-09 22:45:25 UTC
Ok I can reproduce this as described in comment #18 (Ubuntu 12.04 32 bits, LO 3.6.0.2).
The thing is that I can remember having this problem in Writer but can't reproduce this anymore. Has this been fixed seperately in Writer recently? It would make it easier to fix in Draw, wouldn't it? Of course, I have no idea at all :)
Comment 20 bfoman (inactive) 2012-11-04 19:54:15 UTC
*** Bug 56751 has been marked as a duplicate of this bug. ***
Comment 21 Aaron Digulla 2013-02-25 11:42:37 UTC
There is a simple workaround: Create an empty text document, paste the image in there, copy it again and now paste it into Impress.

Tested with 3.6.5.2 (Build ID: 5b93205) on Linux
Comment 22 sasha.libreoffice 2013-02-25 12:03:55 UTC
workaround not works in 4.0.0 on RFR 17 64bit
picture opened in Gimp, then Ctrl-A, Ctrl-C and in Writer Ctrl-V
Comment 23 lisamiller1963 2014-02-12 05:50:00 UTC
Same problem here - or probably related.

1) Copy parts of a presentation (in my case from Keynote) to the clipboard
2) Paste it into writer
3) Result is that is has a black background instead of the original white background.

Enviroment:
- Mac OSX 10.9.1
- Writer 4.1.4.2
- Keynote 6.1

What does work, is put an empty white box at the background of my presentation and then copy it. So it seems that a presentation (vector image?) with a transparent background is drawn with a black background.
Comment 24 lisamiller1963 2014-02-13 02:37:27 UTC
*** Bug 70996 has been marked as a duplicate of this bug. ***
Comment 25 Michael Meeks 2014-02-14 13:06:19 UTC
I'm routinely annoyed by this - though it works sometimes =)
Comment 26 Michael Meeks 2014-02-14 16:09:20 UTC
Even more annoyingly, I can't reproduce it with master under Linux now; either in writer or draw with the attached image.
Comment 27 Michael Meeks 2014-02-14 16:41:22 UTC
Reproduces under windows. The magic COM interface we get these nasty integer format IDs from is documented here: eg. 49383 -> 0xc0e7 -> text/html (obviously !)

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682177%28v=vs.85%29.aspx
Comment 28 dE 2014-03-26 06:50:03 UTC
Confirmed under LO draw.
Comment 29 Jan Holesovsky 2014-03-28 19:49:20 UTC
I have been testing this on Windows, and what happens is that when you copy it in Gimp, then it is 3 times on the clipboard: as PNG, Device independant bitmap, and Bitmap.

When you Paste Special to PowerPoint, and choose DIB or Bitmap, you will get the same effect as in LibreOffice - black instead of transparency.  So only pasting as PNG gives you what you want.

Now the good news.  I have tested with the LibreOffice master, and was unable to reproduce the problem.  I was searching, and found out it was fixed by commit 6e3dee395baaf333f0b5b7eae18200bbe5e4c555; when I reverted that, it again pasted with the black background.

So we can close this bug finally; I'll cherry-pick the commit to stable branches.
Comment 30 Jan Holesovsky 2014-03-28 20:04:32 UTC
Gerrit requests for 4.2:

https://gerrit.libreoffice.org/8784
https://gerrit.libreoffice.org/8785

Too large work for attempting to cherry-pick to 4.1, unfortunately.
Comment 31 ivana.bosnic 2016-02-26 10:03:39 UTC
Sorry if I'm missing something, but I still experience this bug always (as it was throughout different LO versions).

Windows 7, tested under 5.1.0.3 Portable and 5.0.0.5 installation.
Image pasted with black background, Insert from file works fine.

Could some of you who had the same problem recheck it, to hopefully reopen the bug? Thanks.
Comment 32 Michael Meeks 2016-02-26 16:40:39 UTC
Ivana - perhaps you could file a new bug; that helps to motivate people =) also - clearly Kendy fixed this issue for me, and lots of others long ago. It would be good to have a new, clear-cut, clean description of the issue - with the correct platform, application being pasted from, test file etc. so it doesn't confuse this old issue.

Thanks !