LC Bug: Copying an Image fails
Sean Cole (Pi)
sean at pidigital.co.uk
Tue Mar 16 13:35:01 EDT 2021
Curry,
The issue here is that MS Word controls how that clipboard data is
transferred. As an example
Open the taskmanager
In Word, copy an image into the clipboard
In LC message box type
lock the clipboard; put the keys of the rawclipboarddata
Returns something like:
Art::GVML ClipFormat
PNG
GIF
CF_ENHMETAFILE
CF_METAFILEPICT
CF_BITMAP
JFIF
Object Descriptor
image/svg+xml
In LC message box, type
lock the clipboard; put the rawclipboarddata["Art::GVML ClipFormat"]
LC Locks up
Then switch to TaskManager and see that MSWord has sprung into life. At
this stage it is trying it's best to transfer that data into LC, but
probably can't work out how, so they end up in a loop of errors.
If you type into the messagebox:
lock the clipboard; put the rawclipboarddata["CF_BITMAP"]
or any other CF_, it crashes out of LC altogether.
Copy the image from MSWord, paste into MSPaint and immediately copy into
the clipboard again. Now in LC MsgBx type:
lock the clipboard; put the keys of the rawclipboarddata
Returns something like:
Embed Source
Object Descriptor
CF_METAFILEPICT
CF_DIB
Now:
lock the clipboard; put the rawclipboarddata["CF_DIB"]
and you get the raw data of the image. You cannot do this directly from
MSWord clipboard data.
There might be a way to achieve it using a 'do as javascript' and following
guides listed here:
https://ourcodeworld.com/articles/read/491/how-to-retrieve-images-from-the-clipboard-with-javascript-in-the-browser
All the best
Sean
On Tue, 16 Mar 2021 at 15:40, Curry Kenworthy via use-livecode <
use-livecode at lists.runrev.com> wrote:
>
> LC Bugathon continues....
>
> Recently I ran into this bug, which Trevor already reported:
>
> "Unable to paste images copied from Microsoft Word on Windows"
> https://quality.livecode.com/show_bug.cgi?id=21906
>
> Copying an image directly (not inline with text) fails.
> The clipboarddata contains nulls, in testing so far.
> Just tested on 9.6.2 RC 3.
>
> Any known script workaround?
>
> (A user behavior workaround, ie copying inline, is not very acceptable.)
>
> Best wishes,
>
> Curry Kenworthy
>
> Custom Software Development
> "Better Methods, Better Results"
> LiveCode Training and Consulting
> http://livecodeconsulting.com/
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list