<ul dir="auto">
<li>Electron version: 1.4.15</li>
<li>Operating system: Elementary OS (Ubuntu)</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">NativeImage object copied on clipboard.</p>
<h3 dir="auto">Actual behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="remote.js:217 Uncaught Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from #&lt;Object&gt;
Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from #&lt;Object&gt;
    at callFunction (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/rpc-server.js:235:11)
    at EventEmitter.&lt;anonymous&gt; (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/rpc-server.js:342:5)
    at emitMany (events.js:127:13)
    at EventEmitter.emit (events.js:201:7)
    at WebContents.&lt;anonymous&gt; (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/api/web-contents.js:231:13)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)"><pre class="notranslate"><code class="notranslate">remote.js:217 Uncaught Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from #&lt;Object&gt;
Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from #&lt;Object&gt;
    at callFunction (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/rpc-server.js:235:11)
    at EventEmitter.&lt;anonymous&gt; (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/rpc-server.js:342:5)
    at emitMany (events.js:127:13)
    at EventEmitter.emit (events.js:201:7)
    at WebContents.&lt;anonymous&gt; (/home/mike/dev/onion-packer/node_modules/electron/dist/resources/electron.asar/browser/api/web-contents.js:231:13)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)
</code></pre></div>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">clipboard.writeImage(nativeImage.createFromPath(path));</p>
<h3 dir="auto">Further Info</h3>
<p dir="auto">I noticed that it works fine on Windows. I tried the solutions suggested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="193887182" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/8151" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/8151/hovercard" href="https://github.com/electron/electron/issues/8151">#8151</a> without success.</p>
<ul dir="auto">
<li>Electron version: 1.4.10</li>
<li>Operating system: MacOS</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Captured image from webview is copied into clipboard</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Crashes with error message</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught TypeError: Error processing argument at index 0, conversion failure from [object Object]"><pre class="notranslate"><code class="notranslate">Uncaught TypeError: Error processing argument at index 0, conversion failure from [object Object]
</code></pre></div>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">I am capturing a region of a webview object and then saving as an image (works pretty ok, although sometimes the image is empty), then I am trying to copy the NativeImage into clipboard, but it crashes</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="webview.capturePage(rect, image =&gt; {
              const quality = 90
              const filename = 'image.jpg'
              const fullPath = path.join(__dirname, filename)
              fs.writeFile(fullPath, image.toJPEG(quality), (err) =&gt; {                
                 // TODO: retry save if the image is 0 size
                clipboard.writeImage(image)
              })
})"><pre class="notranslate"><span class="pl-s1">webview</span><span class="pl-kos">.</span><span class="pl-en">capturePage</span><span class="pl-kos">(</span><span class="pl-s1">rect</span><span class="pl-kos">,</span> <span class="pl-s1">image</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
              <span class="pl-k">const</span> <span class="pl-s1">quality</span> <span class="pl-c1">=</span> <span class="pl-c1">90</span>
              <span class="pl-k">const</span> <span class="pl-s1">filename</span> <span class="pl-c1">=</span> <span class="pl-s">'image.jpg'</span>
              <span class="pl-k">const</span> <span class="pl-s1">fullPath</span> <span class="pl-c1">=</span> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s1">filename</span><span class="pl-kos">)</span>
              <span class="pl-s1">fs</span><span class="pl-kos">.</span><span class="pl-en">writeFile</span><span class="pl-kos">(</span><span class="pl-s1">fullPath</span><span class="pl-kos">,</span> <span class="pl-s1">image</span><span class="pl-kos">.</span><span class="pl-en">toJPEG</span><span class="pl-kos">(</span><span class="pl-s1">quality</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>                
                 <span class="pl-c">// TODO: retry save if the image is 0 size</span>
                <span class="pl-s1">clipboard</span><span class="pl-kos">.</span><span class="pl-en">writeImage</span><span class="pl-kos">(</span><span class="pl-s1">image</span><span class="pl-kos">)</span>
              <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">I can see the image on the disk, but the clipboard has never received it, always crashing</p>