Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency from browserWindow.capturePage is lost after calling nativeImage.resize #12308

Closed
countravioli opened this issue Mar 15, 2018 · 1 comment · Fixed by #12561
Closed

Comments

@countravioli
Copy link

countravioli commented Mar 15, 2018

  • Electron version: 2.0.0beta3 & 1.8.3
  • Operating system: OSX & Windows 10 64bit

Expected behavior

Resizing a nativeImage that is a product of calling BrowserWindow.capturePage should maintain transparency in all cases, not just when hardware acceleration is disabled

Actual behavior

Resizing a nativeImage that is a product of calling BrowserWindow.capturePage converts tranparent pixels to black. If you instantiate your app disabling the gpu / hardware acceleration (app.disableHardwareAcceleration) it works as one would expect.

How to reproduce

git clone https://github.com/countravioli/electron-native-image-resize-transparency-bug
cd electron-native-image-resize-transparency-bug
npm install
npm start
npm run start-works

npm start - will run the app normally, illustrating the bug. Two images are written in the directory at the same level as app.js (original.png and resized.png)
npm run start-works - will run the app with disableHardwareAcceleration showing things work. The same to pngs are created.

The app will quit when its done. If you are on mac the pngs will open in your default application associated with the file type.

@nitsakh
Copy link
Contributor

nitsakh commented Apr 5, 2018

Related to #10994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants