Bug 210539 - okular clipboard does not export image/png correctly
Summary: okular clipboard does not export image/png correctly
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 14:32 UTC by Aniket Ray
Modified: 2009-10-22 21:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Binary of application to reproduce bug. (8.42 KB, application/octet-stream)
2009-10-21 13:30 UTC, Aniket Ray
Details
C source of application to reproduce bu (2.29 KB, text/x-csrc)
2009-10-21 13:33 UTC, Aniket Ray
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aniket Ray 2009-10-14 14:32:55 UTC
Version:            (using KDE 4.3.0)
OS:                Linux
Installed from:    Ubuntu Packages

Steps to reproduce
1. Select and Copy to clipboard a large image in okular
2. It exports in image/png, image/jpeg and PIXMAP formats.
3. Try to read the contents of the clipboard using gtk_clipboard_wait_for_contents
4. The gtk calls waits for a long time and then returns a NULL while waiting for png content. jpeg content works immediately and returns jpeg content immediately.


This can be randomly using ksnapshot tool as well. Although it is very consistent on okular for large images.
When copying an image in firefox or openoffice, the same images exported as image/png are read fine.

Happens on Kubuntu, FC 11 KDEs and OpenSuse 11 KDEs as well.
Comment 1 Albert Astals Cid 2009-10-19 00:58:04 UTC
You say "1. Select and Copy to clipboard a large image in okular", with that you mean you opened a image file or you opened a pdf or does not matter?

How large is "large"?

You say "This can be randomly using ksnapshot tool as well." you mean you have the same problem when using ksnapshot?

Also, can you provide a program that calls gtk_clipboard_wait_for_contents? You don't expect us to know gtk programming, right?
Comment 2 Aniket Ray 2009-10-21 09:05:45 UTC
>How large is "large"?
Not too large, say 800 x 600 pixels should be enough to make it wait for long periods. 

>the same problem when using ksnapshot?
Well, ... on ksnapshot it happens on some installations. I installed the same KDE on a few different machines. It happened with ksnapshot on a few machines and it didn't on a few others. With okular it happened on all machines I installed it on.

>Also, can you provide a program that calls gtk_clipboard_wait_for_contents?
Sorry, about that, would be doing this in a while.

Thanks.
Comment 3 Aniket Ray 2009-10-21 13:30:32 UTC
Created attachment 37705 [details]
Binary of application to reproduce bug.
Comment 4 Aniket Ray 2009-10-21 13:33:23 UTC
Created attachment 37706 [details]
C source of application to reproduce bu

Compile the source using the following

gcc -o GtkClipboardBug GtkClipboardBug.c `pkg-config gtk+-2.0 --cflags --libs`

To reproduce the bug.

1. Launch the application
2. Right click and select a large image (around 1000 x 800 pixels) in okular and select "save to clipboard".
3  Click on get targets, the output is returned on the terminal. Notice the long times taken to read image/png format and after that the data is not found.
Comment 5 Albert Astals Cid 2009-10-22 21:15:57 UTC
I can not reproduce the problem for image/png but i can for image/pcx for example

Anyway this is for sure not an okular problem, all we do is 
                    QClipboard *cb = QApplication::clipboard();
                    cb->setPixmap( copyPix, QClipboard::Clipboard );
and Qt handles the rest of the clipboard interaction so you want to file a bug against Qt/Nokia about it, sorry i can not help more.