Page 1 of 1

How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 1:07 am
by Brother Gabriel-Marie
So I'm writing an email and I want to display certain png files in my email. I don't want to embed them because I don't want to send hi-res versions. All I want is a nice bmp on the clipboard.
Naturally, I turn to XnView and load up my image there.

However, now I have obstacles.
1. If I copy the png to the clipboard, it does not copy the image like I see it in the image viewer. The copy process loses all the transparency.
2. I can't just take a screenshot of the image in the Image Viewer - it has that checkerboard effect behind it (so I know there is transparency in the image).

I *suppose* that I could hunt through the preferences and disable the checkerboard setting - but that is a pain just to copy one image to clipboard - way more work than I'm interested in.

So what do I do? I do way more work than I want to do anyway and go and post my disappointment on XnView's forum...

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 1:45 am
by XnTriq
Did you use the correct keyboard shortcut (Ctrl+Shift+C), Br. Gabriel-Marie?
  • EditCopy to clipboardImage data
If a Microsoft Office program is the destination, you probably have to use “Paste Special”.

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 2:05 am
by Brother Gabriel-Marie
XnTriq, well, no, in fact, I used the wrong keyboard command - I just used ctrl+c
But in fact, the correct keyboard command *does* work!

So if copy image data copies the actual image, what exactly does plain old copy do?

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 2:20 am
by XnTriq
Brother Gabriel-Marie wrote:So if copy image data copies the actual image, what exactly does plain old copy do?
EditCopy (Ctrl+C) copies the path of (a) seleted file(s) to the clipboard and is used for copying files from one location to another.
  • Browse mode: cmd_copyFile
  • View mode: cmd_copy

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 2:36 am
by Brother Gabriel-Marie
I mean in Image View mode.
When I push ctrl+copy in the Image Viewer it normally copies the image to the clipboard. But it obviously doesn't do the same as copy image data.

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 2:45 am
by XnTriq
My tests on Windows:
  1. Open an image in MP's viewer and press Ctrl+C.
  2. Go to EditImport clipboard: Image data is pasted.
  3. Repeat step #1.
  4. Switch to the browser, navigate to a different folder and press Ctrl+V: File is pasted.
  5. Repeat step #1.
  6. Switch to a file manager, open a folder and press Ctrl+V: File is pasted.
  7. Repeat step #1.
  8. Switch to a text editor and press Ctrl+V: File path is pasted.
It seems that in view mode, path and image data are copied to the clipboard with Ctrl+C.

Related: Request: Remove "Copy pathname" and replace it with...

Re: How to copy png to clipboard properly

Posted: Mon Feb 06, 2017 11:22 pm
by Brother Gabriel-Marie
XnTriq,

Ah - you miss my point.
I'm not trying to copy and paste files.

Let's try this way.
1. Open a png file in MP's viewer and press ctrl+c
2. Start a new email in Thunderbird, focus the message editor and press ctrl+v
3. Now try that using ctrl+shift+c and ctrl+v

Using ctrl+c to copy the image (not the filename) results in the image copied to the clipboard without transparency
Using ctrl+shift+c to copy the image results in the actual image copied to the clipboard with transparency

In MP, when you use ctrl+c - it copies several things to the clipboard simultaneously - it copies the filename (for pasting into text-only situations) and it copies the image data (bmp, I think). The clipboard is able to store different types of data at the same time. (another example is in MS Word - when you copy text from there, both the rich text is copied AND the plain text is copied, too).

I was just surprised that the image was copied without transparency when I used ctrl+c.

Re: How to copy png to clipboard properly

Posted: Tue Feb 07, 2017 1:15 am
by XnTriq
Brother Gabriel-Marie wrote:In MP, when you use ctrl+c - it copies several things to the clipboard simultaneously - it copies the filename (for pasting into text-only situations) and it copies the image data (bmp, I think).
Exactly. I tried to illustrate this bahavior in my previous post.
Brother Gabriel-Marie wrote:I was just surprised that the image was copied without transparency when I used ctrl+c.
:-) Me too, and that's why I'd like to find out why Ctrl+C loses the transparency while Ctrl+Shift+C doesn't.

There was a similar discussion a while back, …
… but the focus was on XnView Classic which has a special INI setting.

logo.png @ XnView MP v0.84 x32:
Browse mode → [color=green]Ctrl+Shift+C[/color] wrote:

Code: Select all

Format | Format Name             | Handle Type |   Size | Index
-------+-------------------------+-------------+--------+------
    17 | CF_DIBV5                |   Memory    | 55'204 |     1
     8 | CF_DIB                  |   Memory    | 41'656 |     2
 49566 | image/png               |   Memory    |  8'341 |     3
 49567 | image/bmp               |   Memory    | 41'670 |     4
 49568 | image/cur               |   Memory    | 57'182 |     5
 49569 | image/dds               |   Memory    | 55'208 |     6
 49571 | image/icns              |   Memory    |  5'237 |     7
 49572 | image/ico               |   Memory    | 57'182 |     8
 49573 | image/jpeg              |   Memory    |  1'966 |     9
 49574 | image/jpg               |   Memory    |  1'966 |    10
 49575 | image/pbm               |   Memory    |  1'745 |    11
 49576 | image/pgm               |   Memory    | 13'785 |    12
 49577 | image/ppm               |   Memory    | 41'325 |    13
 49581 | image/tif               |   Memory    | 55'286 |    14
 49582 | image/tiff              |   Memory    | 55'286 |    15
 49583 | image/wbmp              |   Memory    |  1'739 |    16
 49584 | image/xbm               |   Memory    |  8'967 |    17
 49585 | image/xpm               |   Memory    | 39'784 |    18
View mode → [color=green]Ctrl+C[/color] wrote:

Code: Select all

Format | Format Name             | Handle Type |   Size | Index
-------+-------------------------+-------------+--------+------
    17 | CF_DIBV5                |   Memory    | 55'204 |     1
     8 | CF_DIB                  |   Memory    | 41'656 |     2
    15 | CF_HDROP                |   Memory    |     46 |     3
 49395 | UniformResourceLocatorW |   Memory    |     40 |     4
 49376 | UniformResourceLocator  |   Memory    |     19 |     5
    13 | CF_UNICODETEXT          |   Memory    |     24 |     6
     1 | CF_TEXT                 |   Memory    |     17 |     7
 49566 | image/png               |   Memory    |  8'341 |     8
 49567 | image/bmp               |   Memory    | 41'670 |     9
 49568 | image/cur               |   Memory    | 57'182 |    10
 49569 | image/dds               |   Memory    | 55'208 |    11
 49571 | image/icns              |   Memory    |  5'237 |    12
 49572 | image/ico               |   Memory    | 57'182 |    13
 49573 | image/jpeg              |   Memory    |  1'966 |    14
 49574 | image/jpg               |   Memory    |  1'966 |    15
 49575 | image/pbm               |   Memory    |  1'745 |    16
 49576 | image/pgm               |   Memory    | 13'785 |    17
 49577 | image/ppm               |   Memory    | 41'325 |    18
 49581 | image/tif               |   Memory    | 55'286 |    19
 49582 | image/tiff              |   Memory    | 55'286 |    20
 49583 | image/wbmp              |   Memory    |  1'739 |    21
 49584 | image/xbm               |   Memory    |  8'967 |    22
 49585 | image/xpm               |   Memory    | 39'784 |    23

Re: How to copy png to clipboard properly

Posted: Wed Feb 08, 2017 8:39 am
by xnview
Brother Gabriel-Marie wrote: I was just surprised that the image was copied without transparency when I used ctrl+c.
But 'copy' copy transparency too into clipboard, on which software do you paste it?
:-) Me too, and that's why I'd like to find out why Ctrl+C loses the transparency while
Ctrl+C add a HDROP (files) to clipboard

Re: How to copy png to clipboard properly

Posted: Wed Feb 08, 2017 2:01 pm
by Brother Gabriel-Marie
Pierre, I usually copy into the Thunderbird message composer.

Re: How to copy png to clipboard properly

Posted: Thu Feb 09, 2017 8:00 am
by xnview
Brother Gabriel-Marie wrote:Pierre, I usually copy into the Thunderbird message composer.
i'll test, in LibreOffice/Paint.net for example, the paste is correct

Re: How to copy png to clipboard properly

Posted: Thu Feb 09, 2017 11:30 pm
by XnTriq
What's your configuration of clipboard.paste_image_type, Br. Gabriel-Marie?