Web Export - Export to Clipboard on Windows does not play well with MS Office

Hier diskutieren die Betatester von PhotoLine untereinander und mit den Entwicklern
User avatar
ono
Mitglied
Posts: 148
Joined: Wed 21 Jul 2010 23:50
Location: Baden, Switzerland

Web Export - Export to Clipboard on Windows does not play well with MS Office

Post by ono » Wed 08 Apr 2020 19:17

I use PL to annotate screenshots a lot then I want to paste such a screenshot usually as a PNG into Outlook's email. The problem is that if I copy the layer directly I often get "Picture can't be displayed" (see below).
PictureCannotBeDisplayed.png
If I do Web Export > Export to Clipboard, PL uses CFSTR_FILECONTENTS or CFSTR_FILEDESCRIPTOR (I believe) that effectively when doing Ctrl+V creates a file attachment in Outlook instead of pasting the image directly into the text.
Outlook.png
So my proposition is as follows, would it be hard to add add an option to File > Save Options > [X] Export to Clipboard as File (enabled by default) then Web Export > Export to Clipboard has current behavior, but if I disable it, then instead it uses RegisterClipboardFormat with "PNG", "JPEG", or whatever else is selected as format, instead of CFSTR_FILECONTENTS. This should make MS Office treat the clipboard contents as an image not a file.

Alternatively can you guys have a look why often copying regular image layer from PL produces this damn "Picture can't be displayed" in MS Office, such as Powerpoint?

Thanks.
You do not have the required permissions to view the files attached to this post.
Adam Strzelecki | nanoant.com | CBCT/PET tomography engineer

Martin Huber
Entwickler
Entwickler
Posts: 3653
Joined: Tue 19 Nov 2002 15:49

Re: Web Export - Export to Clipboard on Windows does not play well with MS Office

Post by Martin Huber » Thu 09 Apr 2020 17:52

ono wrote:
Wed 08 Apr 2020 19:17
I use PL to annotate screenshots a lot then I want to paste such a screenshot usually as a PNG into Outlook's email. The problem is that if I copy the layer directly I often get "Picture can't be displayed" (see below).
If you copy the same layer a second time, you get the same result? How do you copy ("Edit > Copy", "Edit > Merged Copy")? What is the active tool?
Do you use a clipboard manager or the Win10 cloud clipboard or Win10 clipboard history (I don't know its exact name, because I am using a German Windows)?

If you can reproduce the problem, could you send us the file along with instructions (active layer, active tool, copy command)?

Martin

User avatar
ono
Mitglied
Posts: 148
Joined: Wed 21 Jul 2010 23:50
Location: Baden, Switzerland

Re: Web Export - Export to Clipboard on Windows does not play well with MS Office

Post by ono » Sat 11 Apr 2020 19:15

Martin Huber wrote:
Thu 09 Apr 2020 17:52
(...) If you copy the same layer a second time, you get the same result? How do you copy ("Edit > Copy", "Edit > Merged Copy")? What is the active tool?
I think I understand the problem. Using NirSoft's InsideClipboard it looks PhotoLine (22.40b3) is adding image/svg+xml into the clipboard and latest MS Office that has SVG support tries to consume it. Every time I get broken image when pasting to Powerpoint or Outlook I can see random garbage in image/svg+xml Format in my clipboard following closing </svg>. When the image is OK, then there is no garbage after </svg>, so I tend to believe there's a bug in PhotoLine that adds randomly some garbage to SVG buffer, see image below:
PL2240b3_Clipboard.png

P.S. Also I think it would be nice if we could control if we want to put all these PDF, SVG, TIFF, PNG, JPEG into clipboard, so some dedicated Options page to control that would be great. I guess simple list of checkboxes would be enough, so I could leave on PNG on for example.
You do not have the required permissions to view the files attached to this post.
Adam Strzelecki | nanoant.com | CBCT/PET tomography engineer

Martin Huber
Entwickler
Entwickler
Posts: 3653
Joined: Tue 19 Nov 2002 15:49

Re: Web Export - Export to Clipboard on Windows does not play well with MS Office

Post by Martin Huber » Thu 16 Apr 2020 09:46

ono wrote:
Sat 11 Apr 2020 19:15
I think I understand the problem. Using NirSoft's InsideClipboard it looks PhotoLine (22.40b3) is adding image/svg+xml into the clipboard and latest MS Office that has SVG support tries to consume it. Every time I get broken image when pasting to Powerpoint or Outlook I can see random garbage in image/svg+xml Format in my clipboard following closing </svg>. When the image is OK, then there is no garbage after </svg>, so I tend to believe there's a bug in PhotoLine that adds randomly some garbage to SVG buffer, see image below:
That's intersting. Most sizes are a multiple of 4096. I will check that.
ono wrote:
Sat 11 Apr 2020 19:15
P.S. Also I think it would be nice if we could control if we want to put all these PDF, SVG, TIFF, PNG, JPEG into clipboard, so some dedicated Options page to control that would be great. I guess simple list of checkboxes would be enough, so I could leave on PNG on for example.
I am not a fan of too many options. It is a very common problem that people change an option they don't fully understand and wonder later why PhotoLine changed its behavior. And too many options hide the important ones.

In this special case it is very hard for most users to know what kind of clipboard data their application supports best. However, it is questionable whether copying a simple image needs PDF or SVG.

Martin

User avatar
ono
Mitglied
Posts: 148
Joined: Wed 21 Jul 2010 23:50
Location: Baden, Switzerland

Re: Web Export - Export to Clipboard on Windows does not play well with MS Office

Post by ono » Tue 12 May 2020 17:33

I can confirm that Paste to Office apps now works well with PL 22.40b5, and also that SVG is no longer added to the clipboard, so I assume the problem is now resolved. Thank you.
PL2240b5_Clipboard.png
You do not have the required permissions to view the files attached to this post.
Adam Strzelecki | nanoant.com | CBCT/PET tomography engineer