Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - transparency from clipboard
transparency from clipboard
 
   NeoOffice Forum Index -> NeoOffice Beta Releases
View previous topic :: View next topic  
Author Message
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Sat May 16, 2009 3:45 am    Post subject: transparency from clipboard

When pasting (from the clipboard) in Writer an image that carries transparent areas, the transparency is not preserved but the corresponding areas turn black. You can reproduce this bug:
  1. open new Writer document
  2. hit shift-command-control-4
  3. hit space
  4. click in the Writer document window to copy a snapshot of it to the clipboard
  5. paste the clipboard content in the document
The resulting picture has a black border, whereas in the clipboard it is transparent (with some shadow of the window object). This can be verified by creating a new document from the clipboard in Preview and saving the document as png.


Last edited by Gust on Sat May 16, 2009 8:16 am; edited 1 time in total
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat May 16, 2009 7:58 am    Post subject:

I cannot reproduce this. When I take a snapshot on Mac OS X 10.4.11 by pressing your key shortcuts and then draw an area slightly bigger than the Writer window (to include the semitransparent window shadow), the pasted image looks fine in Writer.

When you select the Apple :: About this Mac menu, which version of Mac OS X is show in the dialog that appears?

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Sat May 16, 2009 8:18 am    Post subject:

pluby wrote:
I cannot reproduce this. When I take a snapshot on Mac OS X 10.4.11 by pressing your key shortcuts and then draw an area slightly bigger than the Writer window (to include the semitransparent window shadow), the pasted image looks fine in Writer.

There was an omission in the reproduction steps--I'm sorry. I corrected it.
pluby wrote:
When you select the Apple :: About this Mac menu, which version of Mac OS X is show in the dialog that appears?
10.5.7 on 32-bit Intel. Using NeoOffice 3.0 patch 2 test 2.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat May 16, 2009 8:49 am    Post subject:

Gust wrote:
There was an omission in the reproduction steps--I'm sorry. I corrected it.


Thank you for the updated steps. I can now reproduce this bug. However, I have some bad news. This same behavior occurs in OpenOffice.org 3.0.1 (which NeoOffice 3.0 is based on) so this is an OpenOffice.org bug and not a NeoOffice bug.

The problem is that many of OpenOffice.org's image importers are unable to handle transparent pixels. The clipboard's image is in the TIFF format and that is one of the image formats that OpenOffice.org is unable to handle transparent pixels.

I did find I workaround that will enable you to get the transparent pixels to display correctly in NeoOffice (this workaround also works for OpenOffice.org):

1. Take a snaphot using your first 4 steps

2. Launch the /Applications/Preview application, select the File :: New From Clipboard menu, and then select File :: Save As. In the dialog that appears, select PNG as the format and make sure that the Alpha checkbox is checked and press the OK button to save the image.

3. Drag the .png file that was saved in step 2 into Writer.

Does the workaround work for you? If so, I will see if it is possible to convert the clipboard's TIFF image format to PNG when pasting.

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Sat May 16, 2009 8:58 am    Post subject:

pluby wrote:
Does the workaround work for you? If so, I will see if it is possible to convert the clipboard's TIFF image format to PNG when pasting.
Confirmed--the workaround works for me.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat May 16, 2009 11:12 am    Post subject:

Gust wrote:
Confirmed--the workaround works for me.


OK. I will look at trying to force OpenOffice.org to accept image in PNG format. It is not something that OpenOffice.org supports but I have an idea for a small hacky way to do it without having to change tons of OpenOffice.org code.

It will take a couple of days to try my idea and I will post the results of my attempts once I am done.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed May 27, 2009 7:24 pm    Post subject:

I think that I havefixed this bug by enhancing the OpenOffice.org's image pasting code to recognize the PNG image format if it is available on the system clipboard in both NeoOffice 3.0 and NeoOffice 2.2.5 and I have posted links to test patches in my last post in bug 3486.

Can you copy the applicable link in that bug into your web browser to download the patch, install it, and tell us if the bug is fixed for you?

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Thu May 28, 2009 3:46 am    Post subject:

pluby wrote:
Can you copy the applicable link in that bug into your web browser to download the patch, install it, and tell us if the bug is fixed for you?
Works for me--thanx!
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Sun May 31, 2009 3:38 pm    Post subject:

I was pasting a png image (with transparent background) in NeoOffice and got a crash. I'm pretty sure I have the latest test patch installed, although I'll re-install to make sure.
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Sun May 31, 2009 3:56 pm    Post subject:

OK. I'm definitely using Patch 2 test 8 With NeoMobile. I can't seem to reproduce the crash.

But pasting a png image with a transparent background from the Media Browser, I get a black background in NeoOffice (see attached documents).

It works (transparent background) if I don't use the media browser.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun May 31, 2009 4:05 pm    Post subject:

I can reproduce this as well so I suspect that the Media Browser code is not making the PNG image format available to the system clipboard. I will investigate this and I will report back when I have some news.

As for the crash, it is occurring during the dragging operation in the OpenOffice.org code in a spot unrelated to dragging. So, if you can reproduce this again, let us know and I can investigate it.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun May 31, 2009 10:28 pm    Post subject:

I think that I have fixed the problem with dragging transparent images from the Media Browser and I have posted links to test patches in my last post in bug 3486.

Can you copy the applicable link in that bug into your web browser to download the patch, install it, and tell us if the dragging transparent images from the Media Browser problem is fixed for you?

Patrick
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Mon Jun 01, 2009 2:00 am    Post subject:

I'm using the latest test patch in this topic:

https://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=7413

With the new patch, the problem has changed but isn't fixed. Now the image has a white background, not transparent.

To reproduce, set the background color of you document to red, for example, and drag the image from the Finder (transparent parts are red and change if you switch the bg color) vs. from the Media Browser (transparent parts are white no matter what the bg color is).
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Jun 02, 2009 9:06 am    Post subject:

Samwise wrote:
With the new patch, the problem has changed but isn't fixed. Now the image has a white background, not transparent.

To reproduce, set the background color of you document to red, for example, and drag the image from the Finder (transparent parts are red and change if you switch the bg color) vs. from the Media Browser (transparent parts are white no matter what the bg color is).


I have bad news: my original fix for pasting transparent images never worked. Like you found, my fix only changed the transparent pixels from being black to white.

After spending a full day on this, I found the cause of the problem and it is that the OpenOffice.org code will always convert any pasted images into a 24 bit opaque image. Even worse, when I disabled this conversion, scrolling the document caused all sorts of stray artifacts as the OpenOffice.org code does not expect pasted images to be transparent. Sad

So, unfortunately, since the OpenOffice.org code apparently must convert the image to an opaque image, this is a limitation of the OpenOffice.org code that we cannot fix. I will include the existing code changes in the next NeoOffice patch as at least a white background will at least look transparent when printed.

As for the crashing bug, I was able to reproduce it once and I have an idea of what might be causing it so I will investigate that further.

Patrick

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Jun 02, 2009 1:23 pm    Post subject:

I think that I have fixed the crashing while dragging issue and I have posted links to a NeoOffice 3.0 test patch in my last post in bug 3486.

Can you copy the applicable link in that bug into your web browser to download the patch, install it, and tell us if any hanging or crashing occurs while dragging?

Patrick
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Beta Releases All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.